SDK
JavaScript / TypeScript SDK
Unified SDK for web and Node.js — one install covers features, paywall, auth, and monitor.
Install
npm install github:onelo-tools/onelo-jsInitialize
import { Onelo } from '@onelo/js'
// Initialize once at app startup
const onelo = new Onelo({ publishableKey: 'onelo_pk_live_YOUR_KEY' })
// Identify the user — must be called before using any module
await onelo.identify(userId)Usage
// Features — check feature visibility per user plan
onelo.features.isEnabled('export-button') // → boolean
onelo.features.status('export-button') // → 'enabled' | 'greyed' | 'hidden' | 'upsell'
// Gating — the Features SDK resolves each feature against the user's REAL plan
// (server-side, any plan names). Gate on that or the session entitlement:
if (!onelo.features.isEnabled('export-button')) {
// blocked → render the feature's status (greyed / upsell) + your upgrade flow
}Install: npm install github:onelo-tools/onelo-js • GitHub: github.com/onelo-tools/onelo-js
Your publishable key
Replace onelo_pk_live_YOUR_KEY with your key from the dashboard → SDK tab.