Skip to content

Repository files navigation

👉 Visit the DatoCMS homepage or see What is DatoCMS?


Node.js CI

DatoCMS JS REST API Clients

This monorepo contains API clients to interact with DatoCMS:

  • @datocms/cma-client-browser: Client for the Content Management API (to be used in browser environments).
  • @datocms/cma-client-node: Client for the Content Management API (to be used in NodeJS environments).
  • @datocms/dashboard-client: Client for the Dashboard Management API (can be used in any JS environment).
  • @datocms/rest-api-events: Can be used with any of the above clients to use real-time updates instead of polling to retrieve the result of asyncronous jobs.

You can read more on how to use these clients on the official documentation page.

Looking for a client for the GraphQL Content Delivery API? It's here: @datocms/cda-client

Development

After checking out the repo, run the following:

npm install
npm run build

Then, to run the test suite: npm run test.

To regenerate the code based on the latest DatoCMS JSON API schema:

npm run generate
npm run build

npm run generate writes its own changeset describing the schema sync, so the release notes stay accurate without an extra step.

Describing your changes

Every change worth mentioning in a release needs a changeset — a small markdown file under .changeset/ that records which packages changed and how big the bump is. Create one with:

npm run changeset

Use patch for bug fixes only, minor for new API surface (a schema sync included), and major when something is removed or renamed.

Releasing

npm run publish

The script refuses to start unless you're on an up-to-date main, with a clean tree and logged in to both npm and GitHub (gh auth login). It then builds and runs the whole test suite before touching anything, applies the pending changesets, commits the release, publishes to npm, and only then tags each package @datocms/name@X.Y.Z, pushes, and publishes one GitHub release per tag — whose notes are the changelog entries changesets just wrote. It prints the links when it's done.

If it fails partway through, there is nothing to undo: run it again and it will resume the publish where it stopped.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/datocms/js-rest-api-clients. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The package is available as open source under the terms of the MIT License.


What is DatoCMS?

DatoCMS - The Headless CMS for the Modern Web

DatoCMS is Headless CMS for the modern web. Trusted by 25,000+ businesses, agencies, and individuals, it gives your team one place to manage content and ship it to any website, app, or device via API.

New here? Start with Create free account and the Documentation. Stuck? Ask the Community. Curious what's new? Product Updates.

Building with AI: Agent Skills turn coding assistants (Claude Code, Cursor) into expert DatoCMS developers, with full read/write via the auto-installed CLI. No local terminal? Use the MCP Server instead.

Talking to DatoCMS from code:

  • Content Delivery API (CDA) — the fast, read-only GraphQL API your website/app uses to fetch published content.
  • Content Management API (CMA) — the REST API for creating and updating content, models, and project settings (think scripts, migrations, integrations).
  • CLI — terminal tool for schema migrations and importing from Contentful/WordPress.

Framework guides: end-to-end recipes for fetching content, rendering Structured Text, optimizing images/video, handling SEO, and setting up live preview with visual editing in Next.js, Nuxt, Svelte, and Astro.

Want a head start? Browse our starter projects — ready-to-deploy example sites for popular frameworks.

About

REST API clients to interact with DatoCMS

Resources

Stars

12 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages