Braintrust prompt or dataset promoted notifications on your phone.

Get a push notification when a Braintrust prompt or dataset version is promoted to an environment such as production.

environment_updateAIMonitoring
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into Braintrust

Add it as a webhook for Environment alert.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the Braintrust environment alert webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In Braintrust, go to your project's Settings > Alerts and create an alert of type Environment alert.
  3. Choose the Webhook action and paste your webhook URL as the URL.https://••••••••/•••••••• your personal URL, shown after install
  4. Test the alert (where available) and save.
  5. In your Braintrust project, go to **Settings → Alerts** and create an **environment alert** for the prompts or datasets you want to follow. Choose the **Webhook** action with the URL above.
  6. Environment alerts fire immediately and can't be tested from Braintrust; use the sample in Studio's Test runner instead.
  7. Braintrust doesn't sign webhooks, so keep your endpoint URL private.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// Braintrust → environment update
2// Fires when a prompt or dataset version is promoted to an environment (for example
3// production), if an environment alert with a Webhook action is set up.
4// Docs: https://www.braintrust.dev/docs/admin/automations/alerts
5
6// Only link to real http(s) URLs.
7function link(url, cta) {
8 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
9}
10
11function handleRequest(request) {
12 const body = request.body || {}
13 const automation = body.automation
14 const details = body.details ?? {}
15
16 // Guard: only environment updates; log and time window alerts have their own recipe.
17 if (automation?.event_type !== "environment_update") {
18 console.log(`Ignoring Braintrust "${automation?.event_type ?? "unknown"}" webhook`)
19 return null
20 }
21
22 const kind = details.object_type === "dataset" ? "Dataset" : "Prompt"
23 const object = details.prompt ?? details.dataset ?? {}
24 const name = object.slug ?? object.name ?? object.id ?? kind.toLowerCase()
25 const environment = details.environment?.slug ?? "an environment"
26 const version = details.new_version ? ` (version ${details.new_version})` : ""
27
28 return {
29 title: `🚀 ${kind} promoted to ${environment}`,
30 message: `${name}${version}` + (body.project?.name ? ` · ${body.project.name}` : ""),
31 topic: "Braintrust",
32 // Going to production is worth a heads-up; other environments are routine.
33 priority: environment === "production" ? 0 : -1,
34 buttons: link(automation.url, "View alert"),
35 }
36}
Payload

The Braintrust environment_update webhook

This is what Braintrust sends to your URL for environment alert. It is a sample, trimmed to the fields recipes use.

environment_update · sample.json
1{
2 "details": {
3 "action": "update",
4 "prompt": {
5 "id": "prompt_789",
6 "slug": "support-answer"
7 },
8 "environment": {
9 "slug": "production"
10 },
11 "new_version": "1000192548",
12 "object_type": "prompt"
13 },
14 "project": {
15 "id": "proj_456",
16 "name": "support-bot"
17 },
18 "automation": {
19 "id": "d7c4a519-2b3e-4f5a-8c9d-0e1f2a3b4c5d",
20 "url": "https://www.braintrust.dev/app/acme/p/support-bot/configuration/alerts?aid=d7c4a519",
21 "name": "Production prompt changes",
22 "event_type": "environment_update"
23 },
24 "organization": {
25 "id": "org_123",
26 "name": "acme"
27 }
28}
FAQ

Braintrust prompt or dataset promoted notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into Braintrust and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

Braintrust on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.