22
33Examples demonstrating how to use ` @replanejs/sdk ` across different JavaScript runtimes.
44
5- ## Examples
5+ ## Runtime Examples
66
7- | Runtime | Directory | Description |
8- | ---------| -----------| -------------|
9- | ** Node.js** | [ ` node/ ` ] ( ./node/ ) | Server-side Node.js with TypeScript |
10- | ** Bun** | [ ` bun/ ` ] ( ./bun/ ) | Native TypeScript execution with Bun |
11- | ** Deno** | [ ` deno/ ` ] ( ./deno/ ) | Secure runtime with Deno |
12- | ** Browser** | [ ` browser/ ` ] ( ./browser/ ) | Client-side browser app with Vite |
7+ | Runtime | Directory | Description |
8+ | ----------- | ------------------------ | ------------------------------------ |
9+ | ** Node.js** | [ ` node/ ` ] ( ./node/ ) | Server-side Node.js with TypeScript |
10+ | ** Bun** | [ ` bun/ ` ] ( ./bun/ ) | Native TypeScript execution with Bun |
11+ | ** Deno** | [ ` deno/ ` ] ( ./deno/ ) | Secure runtime with Deno |
12+ | ** Browser** | [ ` browser/ ` ] ( ./browser/ ) | Client-side browser app with Vite |
13+
14+ ## Framework SDKs
15+
16+ For React, Next.js, and Svelte applications, use the dedicated framework SDKs which provide hooks, context providers, and SSR support:
17+
18+ | Framework | Package | Examples |
19+ | ----------- | ------------------- | ----------------------------------------------------- |
20+ | ** React** | ` @replanejs/react ` | [ ` packages/react/examples/ ` ] ( ../../react/examples/ ) |
21+ | ** Next.js** | ` @replanejs/next ` | [ ` packages/next/examples/ ` ] ( ../../next/examples/ ) |
22+ | ** Svelte** | ` @replanejs/svelte ` | [ ` packages/svelte/examples/ ` ] ( ../../svelte/examples/ ) |
1323
1424## Quick Start
1525
1626Each example includes its own README with specific instructions. Generally:
1727
1828### Node.js
29+
1930``` bash
2031cd node
2132npm install
2233REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com npm start
2334```
2435
2536### Bun
37+
2638``` bash
2739cd bun
2840bun install
2941REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com bun start
3042```
3143
3244### Deno
45+
3346``` bash
3447cd deno
3548REPLANE_SDK_KEY=your-key REPLANE_BASE_URL=https://replane.example.com deno task start
3649```
3750
3851### Browser
52+
3953``` bash
4054cd browser
4155npm install
@@ -46,9 +60,10 @@ npm run dev
4660## Features Demonstrated
4761
4862All examples show:
63+
4964- Creating a type-safe Replane client
5065- Getting config values with TypeScript inference
5166- Using context for user-specific config evaluation
5267- Subscribing to real-time config updates via SSE
5368- Graceful shutdown/cleanup handling
54- - Fallback values for offline/error scenarios
69+ - Default values for offline/error scenarios
0 commit comments