{"id":38604827,"url":"https://github.com/amazon-connect/amazon-connect-taskjs","last_synced_at":"2026-01-17T08:37:04.469Z","repository":{"id":38228934,"uuid":"316564069","full_name":"amazon-connect/amazon-connect-taskjs","owner":"amazon-connect","description":"Amazon Connect Task JS - a browser-based contact center integration API for Tasks.","archived":false,"fork":false,"pushed_at":"2023-07-19T00:34:49.000Z","size":3099,"stargazers_count":22,"open_issues_count":12,"forks_count":14,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-08-22T23:53:53.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-27T17:36:29.000Z","updated_at":"2025-05-07T23:49:25.000Z","dependencies_parsed_at":"2023-02-06T12:31:11.953Z","dependency_job_id":null,"html_url":"https://github.com/amazon-connect/amazon-connect-taskjs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/amazon-connect/amazon-connect-taskjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-taskjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-taskjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-taskjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-taskjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-connect","download_url":"https://codeload.github.com/amazon-connect/amazon-connect-taskjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-taskjs/sbom","scorecard":{"id":188574,"data":{"date":"2025-08-11","repo":{"name":"github.com/amazon-connect/amazon-connect-taskjs","commit":"14b3e0aef9b6e1ae1a4fbbdcb23438ca91c19556"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":8,"reason":"Found 5/6 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/amazon-connect/.github/SECURITY.md:1","Info: Found linked content: github.com/amazon-connect/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/amazon-connect/.github/SECURITY.md:1","Info: Found text in security policy: github.com/amazon-connect/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T20:13:41.346Z","repository_id":38228934,"created_at":"2025-08-16T20:13:41.346Z","updated_at":"2025-08-16T20:13:41.346Z"},"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:37:04.370Z","updated_at":"2026-01-17T08:37:04.449Z","avatar_url":"https://github.com/amazon-connect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## AmazonConnectTaskJS\n\n# About\nThe Amazon Connect Task javascript library (TaskJS) gives you the power to handle task contacts when used together with [Amazon Connect Streams](https://github.com/aws/amazon-connect-streams).\n\n# Learn More\nTo learn more about Amazon Connect and its capabilities, please check out\nthe [Amazon Connect User Guide](https://docs.aws.amazon.com/connect/latest/userguide/).\n\n# Getting Started\n\n### Using TaskJS from Github\n```\n$ git clone https://github.com/amazon-connect/amazon-connect-taskjs\n```\n\n### Including TaskJS\n\n[Amazon Connect Streams](https://github.com/aws/amazon-connect-streams) is required to use TaskJS. Ensure you import TaskJS after Streams.\n\nTaskJs v2.0 requires Streams v2.2 or later.\n\n# Building\n1. Install latest LTS version of [NodeJS](https://nodejs.org)\n2. Checkout this package into workspace and navigate to root folder\n3. `npm install`\n4. To build (non-minified):\n    1. `npm run devo` for a non-minified build.\n    2. Find build artifacts in **dist** directory.\n5. To build (minified):\n    1. `npm run release` for a minified build.\n    2. Find build artifacts in **dist** directory.\n6. To run unit tests:\n    1. `npm run test`\n7. To clean node_modules:\n    1. `npm run clean`\n8. To make webpack watch all files:\n    1. `npm run watch`\n\nFind build artifacts in **dist** directory -  This will generate a file called `amazon-connect-task.js` - this is the full Connect TaskJS API which you will want to include in your page.\n\n\n# Usage:\n\nTaskJS provides a `taskSession` instance for each task contact. You can access the `taskSession` by calling the `getMediaController` method on a `taskConnection`. `getMediaController` returns a promise that resolves with a `taskSession` instance.\n\nFor example:\n\n```js\ntaskConnection.getMediaController().then((taskSession) =\u003e { /* ... */ });\n```\n\n## Event Handlers\n\nEach of the following event handlers will pass a message object to the callback function containing the following fields:\n\n* `AbsoluteTime`: UTC timestamp of when the event occurred.\n* `ContentType`: One of the following strings depending on the event:\n  * `application/vnd.amazonaws.connect.event.transfer.initiated`\n  * `application/vnd.amazonaws.connect.event.transfer.succeeded`\n  * `application/vnd.amazonaws.connect.event.transfer.failed`\n  * ` application/vnd.amazonaws.connect.event.expire.warning`\n  * `application/vnd.amazonaws.connect.event.expire.complete`\n* `Id`: The contact ID\n* `InitialContactId`: The [initial contact id](https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md#contactgetoriginalcontactid--contactgetinitialcontactid).\n\n### `taskSession.onTransferInitiated`\n\nSubscribe a method to be invoked when the server has initiated the task transfer.\n\n```js\ntaskSession.onTransferInitiated((message) =\u003e console.log(\"Transfer has initiated\"))\n```\n\n### `taskSession.onTransferSucceeded`\n\nSubscribe a method to be invoked when the task transfer has succeeded.\n\n```js\ntaskSession.onTransferSucceeded((message) =\u003e console.log(\"Transfer has succeeded\"))\n```\n\n### `taskSession.onTransferFailed`\n\nSubscribe a method to be invoked when the task transfer has failed.\n\n```js\ntaskSession.onTransferFailed((message) =\u003e console.log(\"Transfer has failed\"))\n```\n\n### `taskSession.onTaskExpiring`\n\nSubscribe a method to be invoked two hours before the task expires.\n\n```js\ntaskSession.onTaskExpiring((message) =\u003e console.log(\"Task will expire in two hours\"))\n```\n\n### `taskSession.onTaskExpired`\n\nSubscribe a method to be invoked when the task has expired.\n\n```js\ntaskSession.onTaskExpired((message) =\u003e console.log(\"Task has expired\"))\n```\n\n### `taskSession.onMessage`\n\nSubscribe a method to be invoked when any one of the above events has occurred.\n\n```js\ntaskSession.onMessage((message) =\u003e console.log(\"The following event has occurred:\", message.ContentType))\n```\n\n## Methods\n\n### `agent.createTask()`\n\nCreate a new task.\n\n```js\nconst newTask = {\n    name: \"string\", //required, max len: 512\n    description: \"string\", //optional, max len: 4096\n    endpoint: endpointObject, //required for non templated tasks, can be retrieved via `agent.getEndpoints()`. Agent and queue endpoints supported.\n    taskTemplateId: \"string\", //required for templated tasks, ID of the template the task is created from. Template should belong to connect instance\n    previousContactId: \"string\", //optional, the previous contact ID for a linked task\n    references: { //optional. Only URL references are supported for non templated tasks\n    \t\"reference name 1\": { // string, max len: 4096\n    \t\ttype: \"URL\" //required, string, one of connect.ReferenceType types, \n    \t\tvalue: \"https://www.amazon.com\" //required, string, max len: 4096\n    \t},\n        \"reference name 2\": { // string, max len: 4096\n    \t\ttype: \"EMAIL\" //required, string, one of connect.ReferenceType types\n    \t\tvalue: \"example@abc.com\" //required, string, max len: 4096\n    \t},\t\n        \"reference name 3\": { // string, max len: 4096\n    \t\ttype: \"NUMBER\" //required, one of connect.ReferenceType types\n    \t\tvalue: 1000 //required, number\n    \t},\n        \"reference name 4\": { // string, max len: 4096\n            type: \"DATE\", //required, string, one of connect.ReferenceType types\n            value: 1649961230 //required, number\n        },\n        \"reference name 5\": { // string, max len: 4096\n    \t\ttype: \"STRING\" //required, string, one of connect.ReferenceType types\n    \t\tvalue: \"example@abc.com\" //required, string, max len: 4096\n    \t}\t\n    },\n    scheduledTime: \"number\" //optional, UTC timestamp in seconds when the task should be delivered.\n};\n\nagent.createTask(newTask, {\n\tsuccess: function(data) { console.log(\"Created a task with contact id: \", data.contactId) },\n\tfailure: function(err) { /* ... */ }\n});\n```\n\n### `agent.updateContact()`\n\nUpdate a task contact created from a template.\n\n```js\nconst updatedTaskData = {\n    contactId: \"string\", // required, task contact identifier\n    name:  \"string\", // optional, task name\n    description: \"string\", // optional, task description\n    references: { //optional, used to specify updated template fields\n        \"reference name\": { // string\n    \t\ttype: \"NUMBER\" //required, one of connect.ReferenceType types\n    \t\tvalue: 1001 //required, number\n    \t}\n        //see more examples in agent.createTask() description\n    }\n};\n\nagent.updateContact(updatedTaskData, {\n\tsuccess: function() { console.log(\"The task updated successfully\") },\n\tfailure: function(err) { /* ... */ }\n});\n\n```\n\n### `agent.listTaskTemplates()`\n\nLoad a list of task templates that belong to a connect instance\n\n```js\n\nconst queryParams = {// required\n    status: 'active', //optional, string, can be either 'active' or 'inactive'\n    maxResults: 50 //optional, number, max value of 100\n};\n\nagent.listTaskTemplates(queryParams, {\n\tsuccess: function(data) { console.log(\"List of task templates loaded successfully\", data) },\n\tfailure: function(err) { /* ... */ }\n});\n\n```\n\n\n### `agent.getTaskTemplate()`\n\nLoad a template data, including fields, default values and constraints \n\n```js\n\nconst templateParams = {// required\n    id: 'string', //required, string, template ID, template should belong to connect instance\n    version: 'string' //optional, string, task template version\n};\n\nagent.getTaskTemplate(templateParams, {\n\tsuccess: function(data) { console.log(\"Template data loaded successfully\", templateParams.id, data) },\n\tfailure: function(err) { /* ... */ }\n});\n\n```\n\n\n## Enumerations\n\n### `connect.ReferenceType`\nThis enumeration lists the different reference types for a task. Currently supported types: URL, EMAIL, NUMBER, STRING, DATE.\n\n* `ReferenceType.URL`: A URL reference.\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-taskjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-connect%2Famazon-connect-taskjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-taskjs/lists"}