4.6.5 • Published 1 year ago

@pantheon-systems/drupal-kit v4.6.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year ago

Pantheon Systems Drupal Kit

Decoupling Drupal is hard. The goal for this package is to provide helpers to make it easier for customers to integrate backends into their node.js frontends regardless of the frontend framework. If you use Next or Nuxt or the next big thing you can use this to make the hook up to your backend.

Installation

To install this package to use in your application:

npm install @pantheon-systems/drupal-kit

Usage

Modules can be imported from the @pantheon-systems/drupal-kit package. For example, to use Drupal State to source data from your CMS backend:

Import DrupalState in your JavaScript application:

import { DrupalState } from ' @pantheon-systems/drupal-kit';

Create an instance of the store and specify the root of your API:

const store = new DrupalState({
  apiBase: 'https://dev-ds-demo.pantheonsite.io',
});

Get a collection of objects:

const recipesFromApi = await store.getObject({ objectName: 'node--recipe' });

Get a single object:

const recipeFromStore = await store.getObject({
  objectName: 'node--recipe',
  id: '33386d32-a87c-44b9-b66b-3dd0bfc38dca',
});

For more information, consult the full Drupal State documentation

To use addApiRouteHeader, you would first import it like so:

import { addApiRouteHeader } from ' @pantheon-systems/drupal-kit';

Once the function is imported, you can use it as needed:

addApiRouteHeader(response.url, context.res);

API Reference

To see the API reference, visit our monorepo

Contributing

Please see the Contributing guide in our monorepo to contribute to the project.

4.6.6-canary.0

1 year ago

4.6.5

2 years ago

4.6.5-canary.0

2 years ago

4.6.3

2 years ago

4.6.2

2 years ago

4.6.4

2 years ago

4.6.4-canary.0

2 years ago

4.6.2-canary.0

2 years ago

4.6.3-canary.1

2 years ago

4.6.3-canary.0

2 years ago

4.5.0-canary.0

2 years ago

4.6.1-canary.0

2 years ago

4.5.0

2 years ago

4.6.1

2 years ago

4.6.0

2 years ago

4.6.0-canary.1

2 years ago

4.6.0-canary.0

2 years ago

4.3.1-canary.0

2 years ago

4.4.0-canary.1

2 years ago

4.2.1-canary.0

2 years ago

4.2.2-canary.0

2 years ago

4.3.0-canary.1

2 years ago

4.4.0

2 years ago

4.3.0

2 years ago

4.2.1

2 years ago

4.2.0-canary.0

2 years ago

4.2.0

2 years ago

4.1.0-canary.0

3 years ago

4.1.0

3 years ago

4.0.0-canary.0

3 years ago

4.0.0

3 years ago

3.1.0-canary.0

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.1-canary.0

3 years ago

3.0.0

3 years ago

3.0.0-canary.0

3 years ago

2.2.0

3 years ago

2.2.0-canary.0

3 years ago

1.1.5

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.4

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago