Storm LogoStorm Docs
Getting Started
Including Storm.jsAuthenticatingCreating TokensSetting The ThemeNext Steps
Guides
Dialer
Messenger
REST API
Type Definitions

Getting Started

Including Storm.js

Add the following line of HTML just before your </body> tag:

<script src="https://app.stormapp.com/storm.js"></script>

This script will add a Storm object on the window through which you can interact with Storm.

Authenticating

The first method you should call is Storm.auth which authenticates your app and user.

Storm.auth({ token: 'YOUR TOKEN' });

How do you obtain the token? Good question. We'll cover that next.

Creating Tokens

Storm uses JSON Web Tokens for authentication. They're easy to generate yourself.

Here's an example written in Node.js using the jsonwebtoken package:

1import jwt from 'jsonwebtoken';
2
3// issue and sign the JWT with your Storm credentials
4const issuer = 'YOUR VENDOR ID';
5const signature = 'YOUR API KEY';
6
7const payload = {
8 userId: 'YOUR USER ID', // users are created via the Customers REST API
9};
10
11const token = jwt.sign(payload, signature, { issuer, expiresIn: 3600 });
Always generate tokens server-side. Your credentials should not be exposed on the front-end.
We use the terms "user" and "customer" interchangeably. Apologies for any confusion.

Setting The Theme

The setTheme method allows you to dynamically change the theme of all Storm products.

Parameters

NameTypeDefaultDescription
themestringdarkTheme options are dark or light
Storm.setTheme({ theme: 'light' });

Next Steps

For more information about creating and maintaining users, see the Customers REST API.

When you're ready, you can jump into specific documentation for the Dialer or the Messenger.