bru.grpc.* API, and test() / expect() on inbound messages and at the end of the call.
This ships for interactive runs in the app. Collection- and folder-level gRPC scripts, Collection Runner, and CLI are out of scope.
For usage examples, see gRPC APIs in the JavaScript Reference.
Lifecycle hooks
A gRPC call is a connection that exchanges messages and ends with a status. Bruno runs four hooks:
Message lists are always read-only. You cannot add, replace, send, or delete messages from a script.
bru.grpc.request.metadata is writable only in Before Call Start. bru.grpc.response.* is read-only and exists only in After Message Receive and After Call End.
The usual bru.* helpers (variables, sendRequest, sleep, interpolate, OAuth2 credential helpers, console) work in every hook. bru.cookies.* and bru.runner.* are not available on gRPC requests.
How to add a script
- Open a gRPC request.
- Go to the Script (Beta) tab.
- Choose a hook and write JavaScript using the
bru.grpcAPIs. Autocomplete and lint coverbru.grpc.*. - Send the request. Tests from After Message Receive and After Call End appear in the Tests tab.
API reference (tables)
All gRPC data lives underbru.grpc.request.* (client) and bru.grpc.response.* (server). A message is { data, timestamp } — data is the protobuf payload; timestamp is epoch milliseconds (Bruno-specific).
Hook abbreviations: BCS Before Call Start · BMS Before Message Send · AMR After Message Receive · ACE After Call End.
Messages
request.messages is what was transmitted, not what is authored in the UI. It is empty in Before Call Start.
Singular hooks (BMS, AMR) always see one message.
request.messages has many items for client-streaming and bidi; response.messages has many for server-streaming and bidi.
Metadata
Metadata entries are{ key, value }. Keys ending in -bin are binary (values stored as base64). Key matching is case-insensitive.
request.metadata is readable in all four hooks and writable only in BCS. response.metadata is server initial metadata. response.trailers is trailing metadata and includes grpc-status / grpc-message.
Call info and tests
What is not included
- Changing or sending messages from a script (the connect-and-send flow is a later ticket)
- Collection- and folder-level gRPC hooks (folder/collection scripts still run for HTTP only)
- Collection Runner and Bruno CLI execution of gRPC scripts