SDK vs gateway

ComponentGuidance
@routerbrain/sdkPin major (e.g. ^1.0.32); regression-test chat stream + files in a non-production environment before bump
GatewayOperated by RouterBrain; breaking HTTP changes announced in release notes

The SDK wraps the HTTP APIs in Capabilities; new gateway fields are usually backward compatible.

Node.js

  • Minimum Node 18; 20 LTS recommended.
  • Use ESM (import / export, "type": "module" in package.json) when possible.
  • CommonJS projects: const { RouterBrain } = await import('@routerbrain/sdk').

TypeScript

Ships with .d.ts. chatRequest covers OpenAI chat subset + RouterBrain extensions (e.g. plugins.pdf).

Upgrade checklist

  • Read npm / release notes
  • Non-production: non-stream, stream, file upload
  • baseURL still includes /v1
  • No removed stub APIs (Limitations)

Related

API versioning