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

Installation

Install using a package manager:

npm install @drupal-api-client/json-api-client

Or 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

Supporting organizations: 
Project Funding via Pitch-burgh
Sponsored contribution

Project information

Releases