Skip to content

feat(notifications): add Amazon Connect Customer Profiles provider for Push Notifications#14866

Open
soberm wants to merge 1 commit into
feat/connect-customer-profiles-identify-userfrom
feat/connect-customer-profiles-push
Open

feat(notifications): add Amazon Connect Customer Profiles provider for Push Notifications#14866
soberm wants to merge 1 commit into
feat/connect-customer-profiles-identify-userfrom
feat/connect-customer-profiles-push

Conversation

@soberm

@soberm soberm commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Adds a new, opt-in Push Notifications provider backed by Amazon Connect Customer Profiles, exposed as a new subpath export alongside the existing Amazon Pinpoint provider (mirroring how the Analytics Customer Profiles provider is exposed):

  • aws-amplify/push-notifications/customer-profiles
  • @aws-amplify/notifications/push-notifications/customer-profiles

With this provider, initializePushNotifications (device-token registration) and identifyUser register the device with Amazon Connect Customer Profiles instead of calling the Pinpoint UpdateEndpoint API. The authorization mode is selected automatically from the resolved auth session:

  • Authenticated (Cognito user-pool): POST {endpoint}/identify-user with an Authorization: Bearer <accessToken> header; the backend keys the profile on the verified sub.
  • Guest (Identity Pool, unauthenticated): POST {endpoint}/identify-user-guest, SigV4-signed (execute-api) with the guest credentials; the backend keys the profile on the caller's identityId. This lets an app register a device token and receive push before sign-in. On a later authenticated call, pass the prior guest identityId via options.previousGuestIdentityId to fold the guest profile (and its devices) into the authenticated profile (merge-on-sign-in).

Configured through the new notifications.amazon_connect_customer_profiles key in amplify_outputs (Notifications.PushNotification.CustomerProfiles = { endpoint, region }). All public method signatures (identifyUser, IdentifyUserInput, and every on*/get*/request*/setBadgeCount API), the native event bus, and the token lifecycle match the Pinpoint provider 1:1; IdentifyUserInput's options additionally accept optional deviceId/platform/appVersion/previousGuestIdentityId device-registration fields. The Customer Profiles provider does not emit Pinpoint engagement telemetry (_campaign.*/_journey.*), as Amazon Connect Customer Profiles has no client-side event API.

Additive and non-breaking:

  • The default aws-amplify/push-notifications (and @aws-amplify/notifications/push-notifications) export is unchanged and still resolves to the Amazon Pinpoint provider, including its engagement telemetry. The existing aws-amplify/push-notifications/pinpoint subpath is likewise unchanged.
  • @aws-amplify/core gains an optional Notifications.PushNotification.CustomerProfiles config type (Pinpoint config remains supported side-by-side) and parses the new notifications.amazon_connect_customer_profiles amplify_outputs key in addition to the existing Pinpoint notifications config.

⚠️ Stacked PR: This targets feat/connect-customer-profiles-identify-user (the branch behind #14864, which adds the Analytics Customer Profiles identifyUser provider that this builds on). Please retarget this PR to main once #14864 merges.

Issue #, if available

N/A — builds on #14864.

Description of how you validated changes

  • tsc --noEmit passes for @aws-amplify/core, @aws-amplify/notifications, and the aws-amplify umbrella.
  • eslint passes on all changed files.
  • npx changeset status reports a minor bump for @aws-amplify/notifications, @aws-amplify/core, and aws-amplify (no major).
  • New/updated Jest unit tests (39 tests across 5 suites for the new provider, plus 2 added parseAmplifyOutputs cases) exercise real code paths, mocking only the network/auth boundary:
    • resolveConfig — reads PushNotification.CustomerProfiles.
    • resolveCredentials — authenticated (bearer token), guest (credentials + identityId), and neither-present error.
    • registerDeviceWithCustomerProfiles — authenticated Bearer POST /identify-user; guest SigV4-signed POST /identify-user-guest; request body, non-2xx, and network-failure handling; asserts no Pinpoint UpdateEndpoint call.
    • identifyUser.native — device + profile registration, inflight-token race, guest-merge/device option passthrough.
    • initializePushNotifications.native — token → Connect registration, inflight race.
    • parseAmplifyOutputs — new amazon_connect_customer_profiles notifications key (Pinpoint + CP together, and CP-only).

Note: the Jest suites are run locally with --env=node to work around a pre-existing environmental ERR_REQUIRE_ESM (jsdom → http-proxy-agent → @tootallnate/once on Node 18.20.2) that also affects untouched suites; it is unrelated to these changes.

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…ew subpath export

Add an opt-in Push Notifications provider backed by Amazon Connect
Customer Profiles, exposed as a new subpath export alongside the
existing Pinpoint provider (mirroring the Analytics Customer Profiles
provider from #14864):

- aws-amplify/push-notifications/customer-profiles
- @aws-amplify/notifications/push-notifications/customer-profiles

Device-token registration (initializePushNotifications) and identifyUser
register the device with Connect Customer Profiles instead of calling the
Pinpoint UpdateEndpoint API. Authorization mode is selected automatically
from the resolved auth session:

- Authenticated (Cognito user-pool): POST {endpoint}/identify-user with
  Authorization: Bearer <accessToken>; backend keys the profile on `sub`.
- Guest (Identity Pool unauthenticated): POST {endpoint}/identify-user-guest,
  SigV4-signed (execute-api) with the guest credentials; backend keys the
  profile on `identityId`. Enables registering a device token before
  sign-in. On a later authenticated call, options.previousGuestIdentityId
  folds the guest profile (and its devices) into the authenticated profile.

Configured via the new notifications.amazon_connect_customer_profiles
amplify_outputs key (Notifications.PushNotification.CustomerProfiles =
{ endpoint, region }). All public method signatures, the native event bus,
and the token lifecycle match the Pinpoint provider 1:1; IdentifyUserInput
options additionally accept optional deviceId/platform/appVersion/
previousGuestIdentityId device-registration fields. Pinpoint engagement
telemetry (_campaign.*/_journey.*) is intentionally not ported (Connect
Customer Profiles has no client-side event API).

Additive and non-breaking: the default push-notifications export still
resolves to Pinpoint; core gains an optional CustomerProfiles config
type parsed side-by-side with Pinpoint.
@soberm soberm requested review from a team, avi-karthik, pranavosu and sarayev as code owners July 7, 2026 12:32
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fd7f092

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@aws-amplify/notifications Minor
aws-amplify Minor
@aws-amplify/core Minor
@aws-amplify/api-graphql Patch
@aws-amplify/api Patch
@aws-amplify/datastore Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@soberm soberm changed the title feat(notifications): add Amazon Connect Customer Profiles provider for Push Notifications (authenticated + guest) feat(notifications): add Amazon Connect Customer Profiles provider for Push Notifications Jul 7, 2026
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.

1 participant