Examples demonstrating how to use @replanejs/sdk across different JavaScript runtimes.
| Runtime | Directory | Description |
|---|---|---|
| Node.js | node/ |
Server-side Node.js with TypeScript |
| Bun | bun/ |
Native TypeScript execution with Bun |
| Deno | deno/ |
Secure runtime with Deno |
| Browser | browser/ |
Client-side browser app with Vite |
For React, Next.js, and Svelte applications, use the dedicated framework SDKs which provide hooks, context providers, and SSR support:
| Framework | Package | Examples | GitHub README |
|---|---|---|---|
| React | @replanejs/react |
packages/react/examples/ |
README |
| Next.js | @replanejs/next |
packages/next/examples/ |
README |
| Svelte | @replanejs/svelte |
packages/svelte/examples/ |
README |
Each example includes its own README with specific instructions. Generally:
cd node
npm install
REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com npm startcd bun
bun install
REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com bun startcd deno
REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com deno task startcd browser
npm install
# Create .env file with VITE_REPLANE_SDK_KEY and VITE_REPLANE_BASE_URL
npm run devAll examples show:
- Creating a type-safe Replane client
- Getting config values with TypeScript inference
- Using context for user-specific config evaluation
- Subscribing to real-time config updates via SSE
- Graceful shutdown/cleanup handling
- Default values for offline/error scenarios