This project is not covered by Drupal’s security advisory policy.
The Drupal API Client is a set of JavaScript packages that simplify the process of interacting with common Drupal APIs. Most commonly, developers will use our JSON:API client to interface with Drupal's JSON:API endpoints, but we also publish a base API Client package that can be extended, a client for Decoupled Router, and may support other Drupal APIs in the future.
The Drupal API Client takes great care to be framework-agnostic and universal. It can be used:
- with your JavaScript framework of choice, vanilla JavaScript, or even in Drupal itself.
- with or without TypeScript.
- on the server, or on the client.
- with a bundler, or as a script import from a CDN.
Pitch-burgh Updates
- We've completed our Pitch-burgh commitment and released JSON:API Client 1.0. Thanks to all who contributed along the way!
- We've published detailed documentation on GitLab Pages including live code examples.
- We've opened an issue proposing that the Drupal API Client packages be promoted to the Drupal namespace on npm. We'd love your feedback and/or support.
- We're refining our 1.x roadmap and soliciting community feedback. One proposed priority will be TypeScript improvements and automatic type generation.
- If you're using the API Client in any capacity, please let us know.
Installation
Install using a package manager:
npm install @drupal-api-client/json-api-clientOr import from a CDN:
<script type="module">
import { JsonApiClient } from "https://esm.run/@drupal-api-client/json-api-client";
</script>You can then create an instance of the client and retrieve data from Drupal
import { JsonApiClient } from "@drupal-api-client/json-api-client";
const client = new JsonApiClient(
"https://drupal-api-demo.party",
);
const articles = await client.getCollection("node--article");Documentation
Learn much more in our documentation. Begin with either our Quick Start or our full JSON:API Client Tutorial.
Get Involved
- #api-client on Drupal Slack
- Guide to contributing
Project information
- Ecosystem: Decoupled
- Created by brianperry on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.



