What’s changed
v3.0.0 introduces two main changes: Nunjucks templating is now a separate package. If you usetemplateFormat: "nunjucks" with prompts, you must install @braintrust/templates-nunjucks-js and register the plugin at startup. Mustache templating continues to work without any changes.
Improved support for restricted environments. The SDK now provides dedicated builds for Node.js, browsers, edge runtimes (such as Cloudflare Workers and Next.js Edge), and workerd. Bundlers automatically choose the correct build for your target environment, so most users won’t need to make any changes.
Migration steps
Install the Nunjucks plugin (if applicable)
If you use If you only use Mustache templates or no templating at all, skip this step.
templateFormat: "nunjucks", install the plugin package:Troubleshooting
“Nunjucks templating requires @braintrust/templates-nunjucks” — You are usingtemplateFormat: "nunjucks" but haven’t installed or registered the plugin. Follow steps 2 and 3 above.
Type errors after upgrading — If you reference TemplateRendererPlugin in your own code, it is exported directly from braintrust:
If you encounter issues during migration, please open an issue with details about your setup.