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

# Class: DiscoveryClient

> Public discovery and business calls, using only the caller's bearer token.

[browser](/api/modules/browser).DiscoveryClient

Public discovery and business calls, using only the caller's bearer token.
The token provider owns sign-in/refresh; each operation pins one verified
token for its context check and submission.

## Constructors

### constructor

• **new DiscoveryClient**(`options`)

#### Parameters

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.url` | `string` |
| `options.deployment` | `string` |
| `options.branch?` | `null` \| `string` |
| `options.token` | () => `Promise`\<`string`> |
| `options.fetch?` | (`input`: `URL` \| `RequestInfo`, `init?`: `RequestInit`) => `Promise`\<`Response`>(`input`: `string` \| `URL` \| `Request`, `init?`: `RequestInit`) => `Promise`\<`Response`> |

## Methods

### discover

▸ **discover**(`args?`): `Promise`\<[`DiscoveryPage`](/api/modules/server#discoverypage)>

#### Parameters

| Name | Type |
| :- | :- |
| `args` | `DiscoverArgs` |

#### Returns

`Promise`\<[`DiscoveryPage`](/api/modules/server#discoverypage)>

***

### describe

▸ **describe**(`ref`): `Promise`\<[`DiscoveryDescription`](/api/modules/server#discoverydescription)>

#### Parameters

| Name | Type |
| :- | :- |
| `ref` | \`function:$\{string}\` \| \`collection:$\{string}\` \| \`operation:$\{string}\` \| \`interface:$\{string}\` \| \`relation:\$\{string}\` |

#### Returns

`Promise`\<[`DiscoveryDescription`](/api/modules/server#discoverydescription)>

***

### read

▸ **read**(`ref`, `query?`): `Promise`\<`any`>

#### Parameters

| Name | Type |
| :- | :- |
| `ref` | \`collection:\$\{string}\` |
| `query` | `Record`\<`string`, [`Value`](/api/modules/values#value)> |

#### Returns

`Promise`\<`any`>

***

### run

▸ **run**(`ref`, `args`): `Promise`\<`any`>

#### Parameters

| Name | Type |
| :- | :- |
| `ref` | \`function:\$\{string}\` |
| `args` | `Record`\<`string`, [`Value`](/api/modules/values#value)> |

#### Returns

`Promise`\<`any`>

***

### prepare

▸ **prepare**(`input`): `Promise`\<[`RetainedOperationRequest`](/api/modules/browser#retainedoperationrequest)>

Return recovery inputs without submitting. Persist this result before
invoke; preview omits the key and creates no acceptance.

#### Parameters

| Name | Type |
| :- | :- |
| `input` | `Object` |
| `input.ref` | \`operation:\$\{string}\` |
| `input.expected_contract` | `string` |
| `input.request_key` | `string` |
| `input.args` | `Record`\<`string`, [`Value`](/api/modules/values#value)> |

#### Returns

`Promise`\<[`RetainedOperationRequest`](/api/modules/browser#retainedoperationrequest)>

***

### operation

▸ **operation**(`request`, `mode?`): `Promise`\<[`Value`](/api/modules/values#value)>

Return the native receipt or recovery result. Transport/decoding failure
leaves acceptance unknown: recover this same request, never a new key.

#### Parameters

| Name | Type | Default value |
| :- | :- | :- |
| `request` | [`RetainedOperationRequest`](/api/modules/browser#retainedoperationrequest) | `undefined` |
| `mode` | `"invoke"` \| `"preview"` \| `"recover"` | `"invoke"` |

#### Returns

`Promise`\<[`Value`](/api/modules/values#value)>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.