Skip to content

feat: add lookupEndUser to TS, Python, Java SDKs#666

Open
sammccord wants to merge 13 commits intomainfrom
sammccord/cdpsdk-2561-cdp-sdk-add-getenduserbyemail-to-typescript-python-and-java
Open

feat: add lookupEndUser to TS, Python, Java SDKs#666
sammccord wants to merge 13 commits intomainfrom
sammccord/cdpsdk-2561-cdp-sdk-add-getenduserbyemail-to-typescript-python-and-java

Conversation

@sammccord
Copy link
Copy Markdown
Contributor

@sammccord sammccord commented Apr 20, 2026

Description

Adds wrapper methods around the lookupEndUser OpenAPI operation across all three SDK language clients (TypeScript, Python, Java).

The operation searches end users by email address across all email-based authentication methods (email, Google, Apple, GitHub).

Closes CDPSDK-2561.

Tests

  • TypeScript: pnpm test — 473 tests pass, lint + build clean
  • Python: pytest cdp/test/test_end_user_client.py — 50 tests pass, ruff clean
  • Java: make build + make test — green

Checklist

  • Added a changelog entry (TS changeset, Python + Java changelog.d)
  • Updated READMEs (not needed — additive method)
  • e2e tests (deferred — depends on cdp-service deploy of CDPSDK-2560)

@linear
Copy link
Copy Markdown

linear Bot commented Apr 20, 2026

@cb-heimdall
Copy link
Copy Markdown

cb-heimdall commented Apr 20, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

⚠️ Generated Client Files Have Been Modified

This pull request contains manual changes to generated client files. These files are automatically generated from the OpenAPI specification and should not be edited directly.

Please check the workflow logs for details on which files were modified.

To fix this issue:

  1. Revert any manual changes to files in:
    • typescript/src/openapi-client/generated/
    • python/cdp/openapi_client/
    • go/openapi/
    • java/src/main/java/com/coinbase/cdp/openapi/
  2. If you need to change the generated code, update the OpenAPI spec (openapi.yaml) instead
  3. Run the generation commands locally to update the generated files

This comment will be automatically removed once the issue is resolved.

@sammccord sammccord changed the title feat: add getEndUserByEmail to TS, Python, Java SDKs feat: add lookupEndUser to TS, Python, Java SDKs Apr 21, 2026
@sammccord sammccord force-pushed the sammccord/cdpsdk-2561-cdp-sdk-add-getenduserbyemail-to-typescript-python-and-java branch 2 times, most recently from df728c2 to 470b6ed Compare April 23, 2026 02:32
sammccord and others added 10 commits April 28, 2026 14:47
Adds wrapper methods around the new getEndUserByEmail OpenAPI operation
across all three language clients. Searches end users by email across
email, Google, Apple, and GitHub authentication methods.

Closes CDPSDK-2561

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Align SDK wrapper methods with the OpenAPI operationId (lookupEndUser).
Renames method, types, analytics actions, internal API calls, and
changelog entries in TypeScript, Python, and Java.
The API spec changed lookupEndUser from returning a singular EndUser to
{ endUsers: EndUser[] }. Update TypeScript, Python, and Java SDK wrappers
to handle the array response and add unit tests for all three.
@sddioulde sddioulde force-pushed the sammccord/cdpsdk-2561-cdp-sdk-add-getenduserbyemail-to-typescript-python-and-java branch from d44b437 to b328863 Compare April 28, 2026 18:47
@sddioulde sddioulde requested review from 0xRAG and milan-cb and removed request for 0xRAG, milan-cb and sddioulde April 28, 2026 20:38
* endUsers.forEach(endUser => console.log(endUser.userId));
* ```
*/
async lookupEndUser(options: LookupEndUserOptions): Promise<EndUserAccount[]> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we went with "lookup" rather than "get", as in getEndUser?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or add email as a prop to the existing getEndUser

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wondered the same for a bit, maybe sam has more context and can share when back, or jazz. i realized the endpoint is /lookup and it's already been shared with folks so i didnt dig further.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @jazz-cb
Not super clean to have a getEndUser and a lookupEndUser. Either an optional param(s) on existing getEndUser, or rename lookupEndUser to getEndUserByIdentity would be cleaner options IMO

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chatted more in DMs with Saliou – Now understand that this new method can return 0, 1 or more users.

lookupEndUser is problematic for two reasons:

  1. It clashes with getEndUser
  2. It signals that a single end user is returned – from the name it's not clear that multiple end users may be returned

I think a more appropriate name could be findEndUsers. If it's too late to change the API itself, we could "mask" the API here in the SDK by just aliasing the method name to findEndUsers instead of lookupEndUser

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - lookup was settled on as to not overload get end user, or prematurely hog a search namespace, but IMO findEndUsers is cleaner. I'd prefer to mask it here for now and deprecate lookup on the backend in favor of find.

@sddioulde sddioulde requested a review from 0xRAG April 29, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants