Skip to main content

What’s changed

Starting in v2.0.0, Zod is now a peer dependency instead of a bundled dependency. This gives you control over the Zod version in your project and reduces bundle size if you’re already using Zod. The SDK requires Zod v3.25.34 or later.

Migration steps

1

Install Zod

Add Zod v3.25.34+ to your project alongside the Braintrust SDK:
npm install zod@^3.25.34
2

Upgrade the SDK

npm install braintrust@latest
3

Verify your setup

Run your build to ensure everything works:
npm run build
If you see any Zod-related type errors, ensure your Zod version is v3.25.34 or later.

Troubleshooting

“Cannot find module ‘zod’” — You need to install Zod as shown in Step 1. Type mismatches with Zod schemas — If you’re passing Zod schemas between your code and the Braintrust SDK, ensure you’re using the same Zod version. Check for duplicate Zod installations:
npm ls zod
If you encounter issues during migration, please open an issue with details about your setup.