Skip to content

Latest commit

 

History

History

README.md

OpenDecree TypeScript SDK Examples

Runnable examples demonstrating the OpenDecree TypeScript SDK.

Setup

Start the decree server and seed example data:

# From this directory
make setup

This starts PostgreSQL, Redis, and the decree server via Docker Compose, then creates an example schema, tenant, and initial config values.

The tenant ID is written to .tenant-id — examples read it automatically.

Prerequisites

npm install

Examples use tsx to run TypeScript directly:

npm install -g tsx

Examples

Example What it shows Server required
quickstart Type converters (Number, Boolean), try/finally Yes
live-config ConfigWatcher, .on('change'), for await...of Yes
nextjs-integration Singleton watcher pattern for server-side config Yes
error-handling RetryConfig, { nullable: true }, instanceof narrowing Yes

Running an example

# After make setup:
npx tsx quickstart/main.ts

Teardown

make down

Learn more