The `drupal-auth-client` is a JavaScript/TypeScript library designed to facilitate OAuth 2.0 authentication against decoupled Drupal installations. Currently at version 1.0.2, it provides a streamlined interface for interacting with Drupal's `simple_oauth` module, which is a required prerequisite on the Drupal backend. The library primarily supports the `client_credentials` grant type for application-level authentication, making it suitable for server-side or secure client-side applications that need to interact with a Drupal API. While explicit release cadence for this specific package isn't provided, its ecosystem (`@octahedroid`) shows active development. Its key differentiator is its focused integration with Drupal's `simple_oauth` and its explicit support for common frontend frameworks like Next.js and Remix within the broader `@octahedroid` tooling.
npm install drupal-auth-clientVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the Drupal auth client with `client_credentials` and fetching an access token. Ensure `simple_oauth` is configured on your Drupal site.
Ensure `simple_oauth` module is enabled and configured on your Drupal instance, including setting up an OAuth client with a client ID and secret matching those used in this client.
Double-check your `clientId` and `clientSecret` against your Drupal `simple_oauth` client configuration. Consider using environment variables for sensitive credentials in production.
Verify that `https://your-drupal-site.com` (or similar) is the correct base URL for your Drupal instance. Do not include the `/oauth/token` path in the `baseUrl`.
Verify that `simple_oauth` is enabled, an OAuth client is created in Drupal, and the client ID and secret passed to `drupalAuthClient` match the Drupal configuration exactly.
Review your Drupal `simple_oauth` client configuration and ensure the `clientId` and `clientSecret` used in your JavaScript code are identical.
No dependency data recorded yet.