Whenever a NATS feature is added or changed in nats.conf or docker-compose.yml, add or update a corresponding sample under examples/ (currently examples/node/main.ts).
The goal is that anyone reading the examples can see, end-to-end, every feature this deployment exposes — using env vars (NATS_URL, NATS_AUTH_TOKEN, …) so the same code runs locally and against Dokploy.
- Token auth —
connect({ token }) - Pub/sub on subject
- JetStream — create stream, publish, ack
- WebSocket connection (
ws://locally,wss://in Dokploy) — seeexamples/node/views/index.html - Request/reply with streamed events (
jobs.create→{ executionId }, thenexecutions.<id>.>) — seeexamples/node/worker.ts+examples/node/views/index.html - Add an entry here whenever a new feature lands in config (TLS / mTLS, NKey / JWT, accounts, KV, Object store, leaf nodes, cluster, …)
- Keep it minimal and runnable with
pnpm start(ornpm start). - Read all credentials and URLs from env — never hardcode.
- If a new example dir is added (e.g.
examples/python), mirror the same coverage there.