SDK vs gateway
| Component | Guidance |
|---|---|
@routerbrain/sdk | Pin major (e.g. ^1.0.32); regression-test chat stream + files in a non-production environment before bump |
| Gateway | Operated 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"inpackage.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
-
baseURLstill includes/v1 - No removed stub APIs (Limitations)