Create Sessions

A session is a way to authenticate a user and get a token that can be used to access the Blokay platform.

Option 1: Use a RESTful API to obtain a JWT token

curl
NodeJS
PHP
Java
GO
bash
curl -X POST https://app.blokay.com/api.brain/createSession \ -H 'Content-Type: application/json' \ -d '{ "businessId": "your-business-id", YOUR_DATA_HERE }'

Option 2: Use React component to login

tsx
import { SignOut, SignIn, SignForm } from "@blokay/react"; function App() { return ( <div className="container mx-auto"> <SignOut> {/*This is only visible if the user is not signed in*/} <SignForm /> </SignOut> <SignIn>{/*This is only visible if the user is signed in*/}</SignIn> </div> ); }

Option 3: Create JWT for your own

js
import jwt from "jsonwebtoken"; const getJWT = () => { // create params const params = { businessId: 16, // your business id session: {}, // your session data token: `blokay-YOUR-TOKEN`, // your token expiresIn: "1h", // session expires in }; return jwt.sign( { data: { session: params.session }, businessId: params.businessId, }, params.token, { expiresIn: params.expiresIn, } ); };
How to create ChartLines
Click to go
How to create Table
Click to go
On this page

Create Sessions

Option 1: Use a RESTful API to obtain a JWT token

Option 2: Use React component to login

Option 3: Create JWT for your own

View this page on
GitHub

Do you have specific enterprise needs? Contact our sales team.

get enterprise

Make your business efficient in seconds.

Create dashboards and backoffices in seconds
Start now