Check out the starter repository: https://github.com/BoundaryML/baml-examples/tree/main/nextjs-starter
Installation Steps
Install BAML VSCode/Cursor Extension
Install the extension from: https://marketplace.visualstudio.com/items?itemName=boundary.baml-extensionFeatures include:
- Syntax highlighting
- Testing playground
- Prompt previews
Generate the baml_client Package
One of the files in your
baml_src directory will have a generator block. Run this command to auto-generate the baml_client directory with TypeScript code to call your BAML functions:For ESM compatibility, add this to your
.baml generator configuration:Build Integration
You can modify yourpackage.json to run baml-cli generate before building:
package.json