Skip to main content
Bruno allows you to write JavaScript code before sending a request (Pre-request) and after receiving a response (Post-response). Use scripts to generate dynamic data, manipulate requests, parse responses, and set variables. bru lang sample

JavaScript API Reference

The complete bru API — request and response methods, environments, and utilities.

Script Flow

When pre-request and post-response scripts run, and in what order across collection, folder, and request levels.

Inbuilt Libraries

Libraries bundled with Bruno, ready to require in your scripts.

External Libraries

Use npm packages in your scripts with Developer Mode.

JavaScript File

Keep shared script code in standalone .js files inside your collection.

Dynamic Variables

Generate random data like names, emails, and UUIDs on every run.

Request Chaining

Pass data from one request to the next and control execution flow.

Request

The req object — inspect and modify outgoing requests, and send synchronous requests from scripts.

Response

The res object — read status, headers, and body, and query response data.

Variables

Get and set variables from scripts with the Vars tab.