Bando Documentation
TypeScript client
Consume Bando through the official TypeScript client.
Why use the TypeScript client?
Bando provides a REST API that can be consumed directly over HTTP. The TypeScript client is a convenience layer that saves you from manually building all of those requests.
If you are already familiar with working with fetch, think of the client as a typed interface over the Bando API.
Generate an API Key
To consume protected Bando endpoints, you need an API Key. If you do not have one yet, you can generate one using the CLI:
If you use pnpm, you can run the same command with:
The generated key should be configured in the environment where the client will run.
Configure the client
After generating the key, create the client by providing the API URL and the key used for authentication.
What is createBandoClient?
createBandoClient() creates an instance that knows where the Bando API is running and how to authenticate requests.
baseUrl specifies the address where Bando is running.
The API Key is sent to authenticate requests that require protected access.
Working with a collection
After creating the client, you can access a collection using thecollection() method:
From there, you can use the available methods to query and modify documents:
Each method corresponds to a different operation on documents.
Learn findMany() →Learn mutations →