Socket
Book a DemoInstallSign in
Socket

@pantheon-systems/drupal-kit

Package Overview
Dependencies
Maintainers
6
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pantheon-systems/drupal-kit

Pantheon Decoupled Kit's Drupal Kit

4.6.5
latest
Source
npmnpm
Version published
Maintainers
6
Created
Source

Pantheon Systems Drupal Kit

Utilities to help simplify the process of sourcing data from a Drupal backend for a Front-End Site hosted on Pantheon.

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:

DrupalState

  • 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

API Reference

To see the API reference for @pantheon-systems/drupal-kit, visit our docs site

Contributing

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

FAQs

Package last updated on 14 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.