> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usebruno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripting

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](https://mintcdn.com/bruno-a6972042/bKrHa_JvyAqCslj1/images/screenshots/script/scripting.webp?fit=max\&auto=format\&n=bKrHa_JvyAqCslj1\&q=85\&s=425fcc29d0d68635f47de5a2798c3212)

> [card] [JavaScript API Reference](https://docs.usebruno.com/testing/script/javascript-reference.md)
>
> The complete `bru` API — request and response methods, environments, and
> utilities.

> [card] [Script Flow](https://docs.usebruno.com/testing/script/script-flow.md)
>
> When pre-request and post-response scripts run, and in what order across
> collection, folder, and request levels.

> [card] [Inbuilt Libraries](https://docs.usebruno.com/testing/script/inbuilt-libraries.md)
>
> Libraries bundled with Bruno, ready to require in your scripts.

> [card] [External Libraries](https://docs.usebruno.com/testing/script/external-libraries.md)
>
> Use npm packages in your scripts with Developer Mode.

> [card] [JavaScript File](https://docs.usebruno.com/testing/script/js-file.md)
>
> Keep shared script code in standalone `.js` files inside your collection.

> [card] [Dynamic Variables](https://docs.usebruno.com/testing/script/dynamic-variables.md)
>
> Generate random data like names, emails, and UUIDs on every run.

> [card] [Request Chaining](https://docs.usebruno.com/testing/script/request-chaining.md)
>
> Pass data from one request to the next and control execution flow.

> [card] [Request](https://docs.usebruno.com/testing/script/request/request-object.md)
>
> The `req` object — inspect and modify outgoing requests, and send
> synchronous requests from scripts.

> [card] [Response](https://docs.usebruno.com/testing/script/response/response-object.md)
>
> The `res` object — read status, headers, and body, and query response data.

> [card] [Variables](https://docs.usebruno.com/testing/script/vars.md)
>
> Get and set variables from scripts with the Vars tab.

> [card] [gRPC Scripting](https://docs.usebruno.com/send-requests/grpc/scripting.md)
>
> Request-level hooks, `bru.grpc.*` APIs, tests, and assertions on gRPC calls.
