Skip to content

feat: CDK in-app widget paths (DO NOT MERGE until serverless backend lands) - #53

Merged
millerm30 merged 7 commits into
mainfrom
feat/cdk-inapp-api
Sep 24, 2026
Merged

millerm30 merged 7 commits into
mainfrom
feat/cdk-inapp-api

Conversation

@millerm30

@millerm30 millerm30 commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Do not merge yet

Do not merge this until the leftover in-app backend work in serverless is merged and deployed This SDK talks to the CDK routes (/user/inapp, /users/{userId}, /users/{userId}/preferences, /users/account-metadata). Merging or publishing it first would break widgets, because the backend only recognizes the widget token on those routes after that PR deploys.

After the backend is in, publish a new @notificationapi/core and then land the React SDK PR (that one must bump its core dependency to the published version before merge).

Summary

  • Widget REST uses CDK paths instead of leftover /{clientId}/users/{userId}/…
  • The Basic token is now always 3-part: clientId:userId:hashedUserId, with the hash slot empty (trailing colon) when there is no hashedUserId. This is how the backend's shared authenticate authorizer distinguishes a widget token from a server clientId:clientSecret token. hashedUserId is still optional unless the environment has secure mode on — same rule as before.
  • Slack and web-push client APIs/types are removed (sdkDevMode only existed for Slack OAuth)
  • WebSocket auth is unchanged (query params, not the Basic token)

Test plan

  • Packed tarball against api.mike-app.click / ws.mike-app.click (bell, live WS, prefs)
  • Jest suite (17/17)
  • Re-test the no-hash flow with a fresh tarball once the serverless backend deploys (the trailing-colon token requires the new authorizer)

Made with Cursor

millerm30 and others added 3 commits September 15, 2026 17:20
…e client.

Keep Basic clientId:userId[:hashedUserId] auth so existing widgets still work against the new API.

Co-authored-by: Cursor <[email protected]>
The backend distinguishes the widget token from a server
clientId:clientSecret token by it having 3 parts. When secureMode is
off and there is no hashedUserId, the hash slot is sent empty
(clientId:userId:) so the token is never mistaken for a server token.

Co-authored-by: Cursor <[email protected]>
@millerm30
millerm30 removed the request for review from sahandseifi September 17, 2026 16:23
@millerm30
millerm30 marked this pull request as draft September 17, 2026 16:23
…cations and preferences

Refactor the NotificationAPIClientSDK to replace user resource paths with endUser resource paths for fetching and updating notifications and preferences. This change ensures that the SDK correctly targets the new API structure for end users.
…source paths

Adjust the tests for NotificationAPIClientSDK to ensure they correctly reference the new endUser resource paths for user account metadata and user identification. This aligns the tests with the recent changes in the SDK's API structure.
@millerm30
millerm30 marked this pull request as ready for review September 18, 2026 12:57
In-app and preferences drop the user id from the URL so they match cdkAuthUser, which reads the user from the token. Identify still posts to /enduser/{userId}.

Co-authored-by: Cursor <[email protected]>
@millerm30
millerm30 merged commit 3c43769 into main Sep 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants