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-js

Initialize

import { Onelo } from '@onelo/js'

// Initialize once at app startup
const onelo = new Onelo({ publishableKey: 'onelo_pk_live_YOUR_KEY' })

// Sign the user in with Onelo Auth, or connect the sign-in your app already
// has (see the Auth snippet). Every module then acts for the signed-in user
// automatically — there is no identify() call to make.

Usage

// Features — check feature visibility per user plan
onelo.features.feature('export-button').isEnabled   // → boolean
onelo.features.feature('export-button').status      // → '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.feature('export-button').isEnabled) {
  // 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.

JavaScript / TypeScript SDK — Onelo Docs