{"id":38604715,"url":"https://github.com/amazon-connect/amazon-connect-customer-profiles","last_synced_at":"2026-01-17T08:36:56.895Z","repository":{"id":47698696,"uuid":"508463431","full_name":"amazon-connect/amazon-connect-customer-profiles","owner":"amazon-connect","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-19T18:27:47.000Z","size":579,"stargazers_count":10,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-21T15:13:23.744Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-connect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T21:43:03.000Z","updated_at":"2025-05-27T03:45:32.000Z","dependencies_parsed_at":"2023-02-11T20:30:40.956Z","dependency_job_id":null,"html_url":"https://github.com/amazon-connect/amazon-connect-customer-profiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"amazon-archives/__template_Apache-2.0","purl":"pkg:github/amazon-connect/amazon-connect-customer-profiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-customer-profiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-customer-profiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-customer-profiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-customer-profiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-connect","download_url":"https://codeload.github.com/amazon-connect/amazon-connect-customer-profiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-customer-profiles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T08:36:56.107Z","updated_at":"2026-01-17T08:36:56.884Z","avatar_url":"https://github.com/amazon-connect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amazon-connect-customer-profiles\n\n## Description\n\nThe Amazon Connect CustomerProfiles JavaScript library (CustomerProfilesJS) gives you the power to build your own CustomerProfiles widget.\n\nThe library uses Connect authentication token to make API calls to CustomerProfiles service. The client supports all CustomerProfile apis enabled on connect instance.\n\nThe client supports the following apis\n- SearchProfiles\n- CreateProfile\n- UpdateProfile\n- AddProfileKey\n- ListProfileObjects\n- ListAccountIntegrations\n\nFor more details on the apis, check out [CustomerProfiles](https://docs.aws.amazon.com/cli/latest/reference/customer-profiles/index.html) available via the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).\n\n## Getting started\n\n### Pre-requisite\n\n- AmazonConnectCustomerProfiles depends on CCP widget from [AmazonConnectStreams](https://github.com/amazon-connect/amazon-connect-streams)\n- To utilize AmazonConnectCustomerProfiles, start by allow listing your existing web application in the AWS Connect console. To allow list a domain URL follow the [app integration guide](https://docs.aws.amazon.com/connect/latest/adminguide/app-integration.html).\n- Access to CustomerProfile apis can be controlled using [Connect security profiles](https://docs.aws.amazon.com/connect/latest/adminguide/assign-security-profile-customer-profile.html).\n\n### Usage\n\n#### Build your own with NPM\n\namazon-connect-customer-profiles is available from npmjs.com. If you'd like to download it here, you can use either of the files like `dist/amazon-connect-customer-profiles*`.\n\nRun npm run release to generate new release files.\n\n```\n$ git clone https://github.com/amazon-connect/amazon-connect-customer-profiles.git\n$ cd amazon-connect-customer-profiles\n$ npm install\n$ npm run release\n```\n\nFind build artifacts in **dist** directory - This will generate a file called `amazon-connect-customer-profiles.js` and the minified version of the same `amazon-connect-customer-profiles-min.js`.\n\n\n#### Install using NPM\nInstall using `npm`:\n```\nnpm install amazon-connect-customer-profiles\n```\n\n### Initialization\n\nThe order of initialization matters:\n- Embed `connect-streams` javascript library before embedding `amazon-connect-customer-profiles`.\n- Initialize `Connect CCP` before initializing `CustomerProfilesClient`\n\n```html,js\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cscript type=\"text/javascript\" src=\"connect-streams-min.js\"\u003e\u003c/script\u003e\n    \u003cscript type=\"text/javascript\" src=\"amazon-connect-customer-profiles-min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"container-div\" style=\"width: 400px; height: 800px;\"\u003e\u003c/div\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n      let instanceName = 'https://test.my.connect.aws';\n\n      // Initialize streams API\n      var containerDiv = document.getElementById(\"container-div\");\n      connect.core.initCCP(\n        containerDiv,\n       \t...\n      );\n\n      // Initialize customerProfilesJS client\n      client = new connect.CustomerProfilesClient(instanceName);\n\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Requests\n\nCustomerProfilesJS client supports the following api methods.\n\nInitialize the client\n```js\nclient = connect.CustomerProfilesClient(instanceName, endpoint);\n```\n\n### CreateProfile\n\n[CreateProfile](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateProfile.html) - creates a standard profile.\n\n```js\nclient.createProfile({\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\",\n\t\"FirstName\": \"\u003cFIRST_NAME\u003e\"\n});\n```\n\n### UpdateProfile\n\n[UpdateProfile](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateProfile.html) - Updates the properties of a profile. The ProfileId is required for updating a customer profile.\n\n```js\nclient.updateProfile({\n\t\"ProfileId\": \"\u003cPROFILE_ID\u003e\",\n\t\"FirstName\": \"\u003cFIRST_NAME\u003e\",\n\t\"LastName\": \"\u003cLAST_NAME\u003e\",\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\"\n});\n```\n\n### SearchProfile\n\n[SearchProfile](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_SearchProfiles.html) - Searches for profiles within a domain.\n\n```js\nclient.searchProfiles({\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\",\n\t\"KeyName\": \"_profileId\",\n\t\"Values\": [ \"\u003cPROFILE_ID\u003e\" ]\n});\n```\n\n### AddProfileKey\n\n[AddProfileKey](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_AddProfileKey.html) - Associates a new key value with a specific profile, such as a Contact Trace Record (CTR) ContactId.\n\n```js\nclient.addProfileKey({\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\",\n\t\"ProfileId\": \"\u003cPROFILE_ID\u003e\",\n\t\"KeyName\": \"_phone\",\n\t\"Values\": [ \"\u003cPHONE_NUMBER\u003e\" ]\n});\n```\n\n### ListProfileObjects\n\n[ListProfileObjects](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListProfileObjects.html) - Returns a list of objects associated with a profile of a given ProfileObjectType.\n\n```js\nclient.listProfileObjects({\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\",\n\t\"ObjectTypeName\": \"CTR\",\n\t\"ProfileId\": \"\u003cPROFILE_ID\u003e\",\n\t\"MaxResults\": 10\n});\n```\n\n### ListAccountIntegrations\n\n[ListAccountIntegrations](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_ListAccountIntegrations.html) - Lists all of the integrations associated to a specific URI in the AWS account.\n\n```js\nclient.listAccountIntegrations({\n\t\"Uri\": \"\u003cURI\u003e\"\n});\n```\n\n## Response\n\nAll api calls through the client returns a promise. The promise resolves/rejects to provide the results from the api call.\n200 status api status code is resolved and all other status codes are rejected.\n\nClient response contains the following fields\n- `status`: api call status code\n- `statusText`: api call status text\n- `data`: api response data\n\n```json\n{\n\t\"status\": 200,\n\t\"statusText\": \"OK\",\n\t\"data\": {\u003capi_response\u003e}\n}\n```\n\n### Reading response\nYou can use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) to read results from client response.\n\n```js\nclient.createProfile({\n\t\"DomainName\": \"\u003cDOMAIN_NAME\u003e\",\n\t\"FirstName\": \"\u003cFIRST_NAME\u003e\"\n}).then((res) =\u003e {\n\tconsole.log('Success response: ' + JSON.stringify(res));\n}).catch((errorResp) =\u003e {\n    console.log('Error response: ' + JSON.stringify(errorResp));\n});\n```\n\n## Troubleshooting\n\n### Error message: `Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided`\n\nThis indicates that the customer-profiles hidden widget used by the client is not loaded. Ensure user has successfully signed in to connect instance and reload the page.\n\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for more information.\n\n## License\n\nCustomerProfilesJS is distributed under the\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),\nsee LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-customer-profiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-connect%2Famazon-connect-customer-profiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-customer-profiles/lists"}