---
title: BrexOptions
editUrl: false
head: []
template: doc
prev: false
next: false
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

Defined in: [src/core/options.ts:2](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/core/options.ts#L2)

Options for constructing a Brex client.

## Properties

### baseUrl?

> `optional` **baseUrl?**: `string` & `object` \| `"production"` \| `"staging"`

Defined in: [src/core/options.ts:12](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/core/options.ts#L12)

`"production"` (default), `"staging"`, or any absolute base URL.
Note: staging is not a sandbox; it does not accept customer tokens.

***

### defaultHeaders?

> `optional` **defaultHeaders?**: `Record`\<`string`, `string`\>

Defined in: [src/core/options.ts:16](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/core/options.ts#L16)

Headers merged into every request (per-request headers win).

***

### fetch?

> `optional` **fetch?**: (`input`, `init?`) => `Promise`\<`Response`\>

Defined in: [src/core/options.ts:14](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/core/options.ts#L14)

Injectable fetch for tests, proxies, or custom retry layers. Defaults to global fetch.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)

#### Parameters

##### input

`RequestInfo` \| `URL`

##### init?

`RequestInit`

#### Returns

`Promise`\<`Response`\>

***

### token

> **token**: `string` \| (() => `string` \| `Promise`\<`string`\>)

Defined in: [src/core/options.ts:7](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/core/options.ts#L7)

A Brex API token, or a provider called before every request — useful for
OAuth flows where tokens refresh.