Application Development Tools for Drupal

A simple Vanilla JS Library and API

Drupal Module » GitHub Project »

Types of Apps

  • Mobile Applications (Android, iOS, etc)
  • Web Applications
  • Headless Drupal / Decoupled Drupal
  • PhoneGap (Cordova)

Drupal 8 REST

  • Connect
  • User Login / Logout & Account Load
  • Create, Retrieve, Update & Delete Nodes
  • Views Integration

jdrupal-8.min.js »

Drupal 7 Services

  • User Login, Logout and Registration
  • Create, Retrieve, Update & Delete Entities
  • Supports Core Entity Types
  • Views Integration

jdrupal-7.min.js » jdrupal-7.js »

jDrupal...
  • solves many common development needs for Drupal based applications.
  • provides a familiar Drupal coding experience and syntax for developers.
  • runs alongside any frontend client side framework, or with no framework at all.
  • utilizes JavaScript prototypes and promises.

Quick Examples for Drupal 8

Hello World » Docs » API »

// Connect to Drupal and say hello to the current user.
jDrupal.connect().then(function() {
  var user = jDrupal.currentUser();
  var msg = user.isAuthenticated() ?
    'Hello ' + user.getAccountName() : 'Hello World';
  alert(msg);
});
// Load a node and display the title.
jDrupal.nodeLoad(123).then(function(node) {
  alert(node.getTitle());
});
// Login and show the user their id.
jDrupal.userLogin('bob', 'secret').then(function() {
  alert(jDrupal.currentUser().id());
});
// Get results from a view and print the node ids to the console.
jDrupal.viewsLoad('my-view-url').then(function(view) {
  var results = view.getResults();
  for (var i = 0; i < results.length; i ++) {
    var node = new jDrupal.Node(results[i]);
    console.log('node id: ' + node.id());
  }
});

Quick Examples for Drupal 7

Hello World » Docs » API »

// Connect to Drupal and say hello to the current user.
system_connect({
  success: function(result) {
    var msg = Drupal.user.uid == 0 ?
        'Hello World' : 'Hello ' + Drupal.user.name;
    alert(msg);
  }
});
// Load a node and display the title.
node_load(123, {
  success: function(node) {
    alert(node.title);
  }
});
// Login and show the user their id.
user_login("bob", "secret", {
  success: function(result) {
    alert(Drupal.user.id);
  }
});

Getting Started

For complete details, refer to the docs for jDrupal 8 or jDrupal 7.