-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: add Amazon Connect Customer Profiles push notifications #8613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
soberm
merged 13 commits into
main
from
docs/connect-customer-profiles-push-notifications
Jul 30, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
194e104
docs: add Amazon Connect Customer Profiles push notifications (backen…
soberm 84e555a
docs: correct device-storage model, expand framework visibility, and …
soberm d34af22
docs: fix spellcheck and lint issues for Connect Customer Profiles pu…
soberm a7967a4
docs: rename push notifications nav items and hide Pinpoint EOL banne…
soberm c15f032
docs: tidy prose in Customer Profiles push notifications pages
soberm a7f817c
docs: simplify push message template matching explanation
soberm 5509bc0
docs: scope Customer Profiles push notifications to React Native only
soberm afb8486
docs: add permissions, device token, notification interaction, and ba…
soberm 6f3c0e7
Merge remote-tracking branch 'origin/main' into docs/connect-customer…
soberm 030a42d
docs: address review feedback on Customer Profiles push notifications
soberm 18c7ccb
docs: expand notification backend pages to all platforms
soberm 8ee56e3
docs: remove React Native only client links from notification backend…
soberm 59dc886
docs: bound the Pinpoint banner carve-out and align markdown tables
soberm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
...ild-a-backend/add-aws-services/notifications/author-message-templates/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; | ||
|
|
||
| export const meta = { | ||
| title: 'Author message templates', | ||
| description: | ||
| 'Create a push message template with the Amazon Q in Connect API and connect it to an Amazon Connect journey custom action.', | ||
| platforms: [ | ||
| 'javascript', | ||
| 'react-native', | ||
| 'swift', | ||
| 'android', | ||
| 'flutter', | ||
| 'angular', | ||
| 'nextjs', | ||
| 'react', | ||
| 'vue' | ||
| ] | ||
| }; | ||
|
|
||
| export const getStaticPaths = async () => { | ||
| return getCustomStaticPath(meta.platforms); | ||
| }; | ||
|
|
||
| export function getStaticProps(context) { | ||
| return { | ||
| props: { | ||
| platform: context.params.platform, | ||
| meta | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| Amplify provisions the delivery path for your notifications, but not the message content. The text your users receive comes from a **push message template** stored in an Amazon Q in Connect knowledge base. | ||
|
|
||
| <Callout warning> | ||
|
|
||
| **The Amazon Q in Connect console does not support authoring PUSH-channel message templates.** You create and publish push templates with the `qconnect` AWS CLI (or the underlying Amazon Q in Connect API), against the knowledge base that `defineNotifications` provisions. Amplify does not create the templates themselves, and a journey that has no matching template falls back to default placeholder copy. | ||
|
|
||
| </Callout> | ||
|
|
||
| ## Name the template to match your journey | ||
|
|
||
| A push template's name is the only way Amplify links it to a journey: give the template the exact same name as the custom action block in your Amazon Connect journey. | ||
|
|
||
| ## Find your knowledge base ID | ||
|
|
||
| In create mode, `defineNotifications` provisions an empty `MESSAGE_TEMPLATES` knowledge base and associates it with your Amazon Connect instance through the `Q_MESSAGE_TEMPLATES` integration. In attach mode, associate a `MESSAGE_TEMPLATES` knowledge base with your existing Connect instance yourself so this lookup resolves. | ||
|
|
||
| Either way, look up the knowledge base ID with the AWS CLI: | ||
|
|
||
| ```bash title="Terminal" showLineNumbers={false} | ||
| aws connect list-integration-associations \ | ||
| --instance-id <INSTANCE_ID> \ | ||
| --integration-type Q_MESSAGE_TEMPLATES | ||
| ``` | ||
|
|
||
| The knowledge base ID is the last segment of the returned `IntegrationArn`, which ends in `knowledge-base/<KB_ID>`. | ||
|
|
||
| ## Create the message template | ||
|
|
||
| Create the template with `qconnect create-message-template`, using the same name you will give the journey's custom action block: | ||
|
|
||
| ```bash title="Terminal" showLineNumbers={false} | ||
| aws qconnect create-message-template \ | ||
| --knowledge-base-id <KB_ID> \ | ||
| --name 'Push Notification' \ | ||
| --channel-subtype PUSH \ | ||
| --content '{"push":{"apns":{"title":"Hello {{Attributes.firstName}}","body":{"content":"Your order shipped."}},"fcm":{"title":"Hello {{Attributes.firstName}}","body":{"content":"Your order shipped."}}}}' | ||
| ``` | ||
|
|
||
| Per-platform content maps to channels as `push.apns` (Apple Push Notification service, including the sandbox channel) and `push.fcm` (Firebase Cloud Messaging). A platform entry needs both a title and a body to be used; a platform you leave out falls back to default copy for that platform. | ||
|
|
||
| Publish a version after every copy change: | ||
|
|
||
| ```bash title="Terminal" showLineNumbers={false} | ||
| aws qconnect create-message-template-version \ | ||
| --knowledge-base-id <KB_ID> \ | ||
| --message-template-id <TEMPLATE_ID> | ||
| ``` | ||
|
|
||
| ## Personalize the message | ||
|
|
||
| Templates support `{{Attributes.<key>}}` variables, which resolve to the target Customer Profile's fields, including custom attributes set on the profile: | ||
|
|
||
| ```handlebars | ||
| Hello {{Attributes.firstName}}, your order is on the way. | ||
| ``` | ||
|
|
||
| A variable with no matching profile value stays literal in the rendered copy, so use variables only for fields you populate consistently, and prefer copy that reads correctly when a value is absent. | ||
|
|
||
| See the [Amazon Q in Connect message template API reference](https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_CreateMessageTemplate.html) for the full content schema. | ||
|
|
||
| ## Add the custom action to your journey | ||
|
|
||
| Building the journey itself is done in the Amazon Connect console; only template authoring is CLI-only: | ||
|
|
||
| 1. In the Amazon Connect console, navigate to **Journeys** and open or create a journey. | ||
| 2. Add a **custom action** block and point it at the push-delivery Lambda function that Amplify deployed. | ||
| 3. Set the block name to the exact `--name` value you gave the template above, including capitalization. | ||
| 4. Publish the journey. |
68 changes: 68 additions & 0 deletions
68
...rm]/build-a-backend/add-aws-services/notifications/existing-resources/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; | ||
|
|
||
| export const meta = { | ||
| title: 'Use existing AWS resources', | ||
| description: | ||
| 'Attach your Amplify notifications resource to an Amazon Connect Customer Profiles domain that already exists.', | ||
| platforms: [ | ||
| 'javascript', | ||
| 'react-native', | ||
| 'swift', | ||
| 'android', | ||
| 'flutter', | ||
| 'angular', | ||
| 'nextjs', | ||
| 'react', | ||
| 'vue' | ||
| ] | ||
| }; | ||
|
|
||
| export const getStaticPaths = async () => { | ||
| return getCustomStaticPath(meta.platforms); | ||
| }; | ||
|
|
||
| export function getStaticProps(context) { | ||
| return { | ||
| props: { | ||
| platform: context.params.platform, | ||
| meta | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| Pass `domainName` to `defineNotifications` to attach to an Amazon Connect Customer Profiles domain that already exists: | ||
|
|
||
| ```ts title="amplify/backend.ts" | ||
| import { defineBackend } from '@aws-amplify/backend'; | ||
| import { defineNotifications } from '@aws-amplify/backend-notifications'; | ||
| import { auth } from './auth/resource'; | ||
|
|
||
| defineBackend({ | ||
| auth, | ||
| notifications: defineNotifications({ | ||
| domainName: 'amazon-connect-my-instance' | ||
| }) | ||
| }); | ||
| ``` | ||
|
|
||
| In this mode Amplify **attaches** to the domain rather than creating one. It registers the `AmplifyProfile` object type into the domain additively and does not create an Amazon Connect instance or a Customer Profiles domain. Object types that already exist on the domain are left unchanged, so you can attach to a domain that other workloads are using. | ||
|
|
||
| ## Requirements for the existing domain | ||
|
|
||
| The domain must meet the following requirements: | ||
|
|
||
| - **Same AWS account and Region as your Amplify project.** The construct references the domain by name, which resolves only within the account and Region your backend deploys to. | ||
| - **The name must begin with `amazon-connect-`.** This is a functional requirement, not a naming preference. The AWS-managed `AmazonConnectServiceLinkedRolePolicy` grants your Amazon Connect instance access to Customer Profiles only on domains matching `arn:aws:profile:*:*:domains/amazon-connect-*`. A domain named otherwise is unreachable by the instance, and the Amazon Connect console reports that it does not have permission to access Customer Profiles. Because the service-linked role and its managed policy cannot be edited, the domain name is the only way to satisfy the policy. | ||
| - **Customer Profiles enabled on your Amazon Connect instance.** The most common domain to attach to is the one Amazon Connect creates for you when you enable Customer Profiles, which is named `amazon-connect-<instance-alias>`. | ||
|
|
||
| <Callout info> | ||
|
|
||
| To find the domain name, open the [Amazon Connect console](https://console.aws.amazon.com/connect/), select your instance, and choose **Customer Profiles**. | ||
|
|
||
| </Callout> | ||
|
|
||
| ## Properties that do not apply | ||
|
|
||
| `instanceAlias` and `expirationDays` configure a domain that Amplify creates, so they cannot be combined with `domainName`. Set the data retention period on the existing domain in the Amazon Connect console instead. | ||
|
|
||
| To have Amplify create the Amazon Connect instance and the domain for you, see [Set up notifications](/[platform]/build-a-backend/add-aws-services/notifications/set-up-notifications/). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.