Node Express

Follow these steps to implement Kable within your Node Express API.

Estimated completion: 10 minutes

Get the latest version or contribute at:

Install dependencies

First, install the Kable Node Express SDK using npm or yarn.

npm install --save kable-node-express

Implement Kable

const express = require('express');
const app = express();
const { Kable } = require('kable-node-express');

// Initialize Kable with fields found on your Company page in the dashboard
const kable = new Kable({
  kableClientId: '<YOUR_KABLE_CLIENT_ID>',
  kableClientSecret: '<YOUR_KABLE_CLIENT_SECRET>',
  baseUrl: '',
  debug: true

app.get('/api/record', function(req, res) {
  // record data from within your API
  kable.record('yourcompanyuser_1234567890', { userId: 'xyz123' });
  res.json({ message: 'Data has been recorded by Kable!' });

// for using Kable as an authentication provider
app.get('/api/authenticate', kable.authenticate, function(req, res) {
  res.json({ message: 'This request has been authenticated and recorded by Kable!' });