Registering the Client
Log in to add to favouritesInstall the Delivery API client
Install the contensis-delivery-api package to your project dependencies using npm, or your preferred Node.js package manager.
npm install --save contensis-delivery-api
Import the client
Follow the examples with the preferred coding style that best suits your project
// Using TypeScript, or ES Module syntax
import { Client } from "contensis-delivery-api";
// Using Common JS syntax
const { Client } = require("contensis-delivery-api");
Initialise the client
As a minimum, you need to supply the API root URL, access token, and project ID to initialise the client
Example creating a Delivery API client in JavaScript or TypeScript
const client = Client.create({
rootUrl: "https://api-<cms-alias>.cloud.contensis.com",
accessToken: "<environment-access-token>",
projectId: "<project-api-id>",
});
Next steps
We have a Delivery API client connected to our CMS, all operations are available from within this client.
If you are new to using the Delivery API you could test your client by trying one of the following articles first before exploring more complex use cases