Quickstart
-
Install the SDK.
servermints tokens (Node only),clientreads and writes feeds (isomorphic). Building a React UI? Add@dropinnodex/react— it wrapsclientin hooks, and the walkthrough uses it throughout.Terminal window pnpm add @dropinnodex/client @dropinnodex/serverTerminal window npm install @dropinnodex/client @dropinnodex/serverTerminal window yarn add @dropinnodex/client @dropinnodex/server -
Mint a user token on your backend. dropin issues no tokens — your backend signs an HS256 JWT with your tenant
api_secret. This never runs in the browser.// server-only — never bundle this into a browser buildimport { DropInServer } from '@dropinnodex/server'const server = new DropInServer({tenantId: process.env.DROPIN_TENANT_ID!,apiKey: process.env.DROPIN_API_KEY!,apiSecret: process.env.DROPIN_API_SECRET!,url: 'https://api.getnodex.cloud',})// Inside your own token endpoint, after you've authenticated the caller:const token = await server.createUserToken(userId, { expiresIn: '1h' }) -
Construct a client with that token and read a feed.
import { DropInClient } from '@dropinnodex/client'const client = new DropInClient({url: 'https://api.getnodex.cloud',apiKey: process.env.NEXT_PUBLIC_DROPIN_API_KEY!,// Called on init and again on a 401 — fetch a fresh token from your backend endpoint.tokenProvider: async () => {const res = await fetch('/api/token')const { token } = await res.json()return token},})const page = await client.feed('user', userId).get({ limit: 20 })page.results // Activity[] — newest firstpage.next // opaque cursor, or null when there's no more/api/tokenis your endpoint, not ours — it wraps step 2. The walkthrough writes it for both Next.js App Router and Pages Router.
Next: the integration walkthrough builds a complete feed screen.