Introduction to Headless Drupal

Do you want to manage content in Drupal but use something else to deliver it to your users? This is the class for you.

We know Drupal is an amazing platform for making websites. But did you know it’s also a world-class content API that can easily be integrated with a other technologies? In this class you’ll learn how to combine Drupal with Node.js, a popular technology for building highly interactive websites, to build rich digital experiences.

You will write code all day! By the end, you'll have written your first Node.js application(s) and have integrated Node.js's real-time wizardry into Drupal's content management magic.

Learning Objectives

The Four Kitchens Web Chefs will show you how to:

  • Strategies for success when using Drupal as a content API
  • Write code that reads and writes data to and from your Drupal site
  • Write custom API endpoints in Drupal to connect to your realtime application
  • Gain experience with the popular Node.js framework: Express
  • Know what Node.js is good at and when a different tool is better
  • Understand how to use NPM node's world class package manager
  • Write non-blocking asynchronous code and how to spot it's evil twin: synchronous blocking code

Why Node.js?

Node.js is a power tool for writing fast, real time applications. At Four Kitchens we've used it for:

  • Creating a responsive web game that mimics the experience of playing with magnetic poetry on the web, Drupal Poetry
  • Providing a feed ingestion and processing application that processed over 300 feeds per minute and broadcasting them out to hundreds of subscribed sites.
  • Providing real time commenting for live video events on a Drupal site.
  • Building a rich dynamic site for NBC’s The Tonight Show starring Jimmy Fallon.
  • Helping large media clients build a performant and extensible solution for their public facing publication.

The patterns we establish when integrating Node.js can easily be adapted to integrating Drupal with other technologies such as Ruby, iOS, or Android.

What will you receive during the course?

Each attendee will have access to their own development environment that includes all necessary assets and content to jump into the hands-on exercises. The environment will stay up for 30 days after the training. We will post all links and resources on our website, create a mailing list for follow-up questions, and create a Google Doc to collaborative ask questions and share markup during (and after) the training.


  1. Intro to Headless Drupal
    1. When to go Headless (Lecture)
    2. Architecture Patterns (Lecture)
    3. Real world Examples (Lecture)
  2. Drupal Services
    1. Install Services Module (Hands on)
    2. Creating Custom Services Endpoints (Hands on)
    3. Creating Custom Services Endpoints II (Hands on)
    4. Authentication & Permissions (Hands on)
  3. Intro to Node.js
    1. Using NPM (Hands on)
    2. Install Express App (Hands on)
    3. Console.log (Hands on)
    4. Intro to Async Programming (Hands on)


  1. Connecting Drupal and Node.js
    1. Pull content from Drupal (Hands on)
    2. Authentication with Drupal (Hands on)
    3. Theme Drupal Content (Hands on)
    4. Pull content from Drupal II (Hands on)
  2. Caching Drupal Content in Node.js
    1. Intro to caching issues (lecture)
    2. Caching Drupal content using MongoDB (Hands on)
    3. Ping Node.js on changes in Drupal (Hands on)
    4. Advanced Caching issues (Lecture)
  3. Strategies for User Generated Content
    1. Commenting (Lecture)
    2. Creating content in Drupal using Services (Lecture)
    3. Protecting Drupal with queuing (Lecture)

Course Prerequisites


Laptop with SFTP, SSH software and a text editor installed. Any local operating system is fine, but our trainers don't have experience debugging Windows connectivity problems.

For Drupal

Comfortable writing PHP to use Drupal hooks and have written a custom module.
Working knowledge of the services module is helpful, and a great thing to try beforehand. :-)

For Node.js

  • Basic knowledge of JavaScript
  • Have used jQuery for to add functionality
  • Knowledge of JavaScript Object Oriented Patterns.
  • Experience with AJAX patterns helpful
  • Have written applications in JavaScript and/or a C-style Object Oriented programmer comfortable with learning a new language.
  • Comfortable using the command line to navigate directories and launch programs. (cd, ls and the like).

Target audience

  • Drupal Developers who want to learn how to use Drupal as their CMS and an other technology to get that content to their users. In our case that technology will be Node.js.
  • Drupal Developers who are ready to learn a new style of server side programing. If writing javascript code makes you cry this course might make it your new favorite language.
  • Drupal developers who want to better understand how to bring asynchronous functionality to their sites. This class is a beginner intro to Node.js, and is not appropriate for developers who use Node.js on a regular basis.
Course Information
Four Kitchens
Experience level: 
Drupal Version: 
Drupal 7.x
G102 · Exove