Drupal JavaScript SDK

Drupal JavaScript SDK

JavaScript Guide

Get Started Introduction

Guide

Guide to walk you through most common scenarious

Examples

Ample example to jumpstart your developmnent

Showcase

A real world examples using the SDK.

As Easy as 1, 2, 3

1. Install

# install in your project
yarn add -D drupal-js-sdk
1
2
# install in your project
npm install -D drupal-js-sdk
# install the authentication package for example.
npm install -D @drupal-js-sdk/auth
1
2
3
4

2. Import

import { Drupal } from 'drupal-js-sdk';
import { DrupalAuth } from '@drupal-js-sdk/auth';
1
2
const Drupal = require('drupal-js-sdk')
const DrupalAuth = require('@drupal-js-sdk/auth')
1
2

3. Use

const api = new Drupal({baseURL: 'http://example.com'});
const auth = new DrupalAuth(api);
auth.login('admin', 'Z1ON0101');
1
2
3