@zephr/saas-node-server-sdk
v1.1.0
Published
Zephr Node JS Server SDK
Downloads
2
Readme
Zephr NodeJS Server SDK
A NodeJS server SDK to handle Zephr features.
Usage
Modern ES Module
import * as ZephrServer from 'zephr-server-sdk.js';
const zephrServer = ZephrServer.createInstance('ZEPHR_ORG_ID'); // create a server wide instance
// for each users request...
(async () => {
const jwt = '...'; // secure user jwt token
const accessController = await zephrServer.createAccessController({ jwt });
const isFeatureEnabled = await zephrServer.isFeatureEnabled('featureFlag');
if (isFeatureEnabled) {
// Handle user access to feature
} else {
// Handle feature rejection
}
})()
Building and running on localhost
First install dependencies:
npm install
To create a build:
npm run build