Fork me on GitHub

This creates a simple web app for Drupal 8.

To use jDrupal directly on the Drupal front end, see the Drupal Example page.

1. Set up the jDrupal Module

Enable and Configure the jDrupal module for your Drupal 8 site.

2. Create an app folder

Next, create a folder called app to store your application's source code. This folder should live within the same domain as your Drupal website. For example, place it in a new directory called app in your Drupal root:

3. Download jDrupal

Download the tool kit so it lives here:

4. Add an index.html file

Next, create an index.html file to start your app.

<!DOCTYPE html>


      <script src="jdrupal.min.js"></script>
      <script src="app.js"></script>


  <body onload="helloWorld()">
    <p id="msg">Loading...</p>

5. Add an app.js file

Next, create an app.js file to run your app and replace the sitePath value with the URL to your Drupal website.

// Set the Drupal site path.
jDrupal.config('sitePath', '');
function helloWorld() {

  // Connect to Drupal.
  jDrupal.connect().then(function() {

    // Grab the current user account.
    var user = jDrupal.currentUser();

    // Prepare a message for the user.
    var text = 'Hello World';
    if (user.isAuthenticated()) {
      text = 'Hello ' + user.getAccountName();

    // Show the message in the paragraph.
    document.getElementById("msg").innerHTML = text;


6. Run the app

Navigate to to view the Hello World.