{"id":17621101,"url":"https://github.com/amplience/dc-management-sdk-js","last_synced_at":"2025-04-04T16:12:28.133Z","repository":{"id":32913322,"uuid":"145737854","full_name":"amplience/dc-management-sdk-js","owner":"amplience","description":"Amplience Dynamic Content Management SDK","archived":false,"fork":false,"pushed_at":"2025-03-24T01:38:40.000Z","size":4515,"stargazers_count":46,"open_issues_count":19,"forks_count":14,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-28T15:04:25.734Z","etag":null,"topics":["content-management","headless-cms","javascript","sdk","typescript","web"],"latest_commit_sha":null,"homepage":"https://amplience.github.io/dc-management-sdk-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amplience.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-22T16:55:17.000Z","updated_at":"2025-03-19T12:41:27.000Z","dependencies_parsed_at":"2023-10-10T18:39:23.851Z","dependency_job_id":"8903c379-cafa-4674-8f63-90b1993de18a","html_url":"https://github.com/amplience/dc-management-sdk-js","commit_stats":{"total_commits":139,"total_committers":25,"mean_commits":5.56,"dds":0.8561151079136691,"last_synced_commit":"154b8ef9ec03fb4bec114e1bbb05715cd75ab212"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplience%2Fdc-management-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplience%2Fdc-management-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplience%2Fdc-management-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplience%2Fdc-management-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amplience","download_url":"https://codeload.github.com/amplience/dc-management-sdk-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781826,"owners_count":20832912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["content-management","headless-cms","javascript","sdk","typescript","web"],"created_at":"2024-10-22T20:10:39.401Z","updated_at":"2025-04-04T16:12:28.117Z","avatar_url":"https://github.com/amplience.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dc-management-sdk-js\n\n\u003e Official Javascript SDK for the Amplience Dynamic Content API\n\n![Build Status](\u003chttps://img.shields.io/github/workflow/status/amplience/dc-management-sdk-js/Run%20tests%20(Node.js%208.x,%2010.x,%2012.x)\u003e)\n[![npm version](https://badge.fury.io/js/dc-management-sdk-js.svg)](https://badge.fury.io/js/dc-management-sdk-js)\n\nThe management sdk is designed to help build back-office applications such as content automation or web-hook integrations. Please keep in mind the management api is rate limited.\n\n## Installation\n\nUsing npm:\n\n```sh\nnpm install dc-management-sdk-js --save\n```\n\n## Usage\n\nThis sdk can be used with both typescript running on Node.js or regular Javascript running on Node.js. TypeScript type definition files are bundled with the library along with precompiled Javascript versions of all TypeScript classes.\n\n### TypeScript\n\n```typescript\nimport { DynamicContent } from 'dc-management-sdk-js';\n```\n\n### Node.js\n\n```js\nvar dc = require('dc-management-sdk-js');\n```\n\n### Authentication\n\nThe content management API uses either OAuth2 or Person Access Tokens (PAT) to authenticate requests.\n\nWhen using OAuth 2 to create an API client you can provide your API key and secret\nand the client will handle creating authentication tokens.\n\nFor assistance creating API credentials, PAT's and configuring permissions please contact [Amplience Support](https://support.amplience.com/).\n\nA guide for creating and managing PAT's can be found on the [Amplience Developer Hub](https://amplience.com/developers/docs/apis/authorization/personal-access-tokens/).\n\n```typescript\nconst client = new DynamicContent({\n  client_id: process.env.CLIENT_ID,\n  client_secret: process.env.CLIENT_SECRET,\n});\n```\n\nOR\n\n```javascript\nvar client = new dc.DynamicContent({\n  client_id: process.env.CLIENT_ID,\n  client_secret: process.env.CLIENT_SECRET,\n});\n```\n\nCreate a client using a PAT\n\n```typescript\nconst client = new DynamicContent({\n  patToken: process.env.PAT\n});\n```\n\nOR\n\n```javascript\nvar client = new dc.DynamicContent({\n  patToken: process.env.PAT\n});\n```\n\n### Making requests\n\nThe most common top level resources (such as Hub and ContentItem) can be requested directly by calling the appropriate method on the client instance. This will return a native promise that will yield the resource or an error (e.g. if you do not have permission to access the resource).\n\n```javascript\nvar hubs = client.hubs.list();\nvar hub = client.hubs.get('\u003cHUB-ID\u003e');\nvar event = client.events.get('\u003cEVENT-ID\u003e');\nvar edition = client.editions.get('\u003cEDITION-ID\u003e');\nvar contentItem = client.contentItems.get('\u003cCONTENT-ITEM-ID\u003e');\n```\n\nOnce you have a top-level resource, you can lookup related resources and perform related actions by calling one of the methods under the “related” object. Each resource has a different set of related resources and actions.\n\n```javascript\nvar contentRepositories = hub.related.contentRepositories.list();\nvar editionEvent = edition.related.event();\nvar contentItemVersion2 = contentItem.related.contentItemVersion(2);\n```\n\n## Example\n\n```typescript\nimport { DynamicContent, Event } from 'dc-management-sdk-js';\n\nasync function createEvent() {\n  const client = new DynamicContent({\n    client_id: process.env.CLIENT_ID,\n    client_secret: process.env.CLIENT_SECRET,\n  });\n\n  const hubs = await client.hubs.list();\n  const hub = hubs.getItems()[0];\n\n  let event = new Event();\n  event.name = 'happy new year';\n  event.start = '2019-01-01T00:00:00.000Z';\n  event.end = '2019-01-01T23:59:59.999Z';\n\n  event = await hub.related.events.create(event);\n\n  console.log(event);\n}\n\ncreateEvent();\n```\n\nOR\n\n```javascript\nvar dc = require('dc-management-sdk-js');\n\nfunction createEvent() {\n  var client = new dc.DynamicContent({\n    client_id: process.env.CLIENT_ID,\n    client_secret: process.env.CLIENT_SECRET,\n  });\n\n  client.hubs\n    .list()\n    .then(function (hubs) {\n      var hub = hubs.getItems()[0];\n\n      var event = new dc.Event();\n      event.name = 'happy new year';\n      event.start = '2019-01-01T00:00:00.000Z';\n      event.end = '2019-01-01T23:59:59.999Z';\n\n      return hub.related.events.create(event);\n    })\n    .then(function (event) {\n      console.log(event);\n    });\n}\n\ncreateEvent();\n```\n\n## Documentation\n\nPlease use the following documentation resources to assist building your application:\n\n- Dynamic Content Management SDK [Reference documentation](https://amplience.github.io/dc-management-sdk-js/)\n- Dynamic Content Management API [Reference documentation](https://amplience.com/docs/api/dynamic-content/management/)\n- Dynamic Content [User guide](https://docs.amplience.net/)\n\n## Getting Help\n\nIf you need help using the sdk please reach out using one of the following channels:\n\n- Ask a question on [StackOverflow](https://stackoverflow.com/) using the tag `amplience-dynamic-content`\n- Open a support ticket with [Amplience Support](https://support.amplience.com/)\n- Contact your [Amplience Customer Success](https://amplience.com/customer-success) representative\n- If you have found a bug please report it by [opening an issue](https://github.com/amplience/dc-management-sdk-js/issues/new)\n\n## License\n\nThis software is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),\n\nCopyright 2018 Amplience\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplience%2Fdc-management-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famplience%2Fdc-management-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplience%2Fdc-management-sdk-js/lists"}