# Class RivetClient

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:10
- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:29

##### Index

### Constructors

constructor

### Properties

_datacenters
_health
_namespaces
_options
_runners

### Accessors

datacenters
health
namespaces
runners

### Methods

_getAuthorizationHeader
actorsCreate
actorsDelete
actorsGetOrCreate
actorsList
actorsListNames
runnerConfigsDelete
runnerConfigsList
runnerConfigsRefreshMetadata
runnerConfigsServerlessHealthCheck
runnerConfigsUpsert

## Constructors

### constructor

- new RivetClient(_options: Options): RivetClient

  #### Parameters

  - _options: Options

  #### Returns RivetClient

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:35

## Properties

### `Protected`_datacenters

_datacenters: Datacenters | undefined

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:31

### `Protected`_health

_health: Health | undefined

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:32

### `Protected`_namespaces

_namespaces: Namespaces | undefined

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:33

### `Protected` `Readonly`_options

_options: Options

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:30

### `Protected`_runners

_runners: Runners | undefined

- Defined in engine/sdks/typescript/api-full/types/Client.d.ts:34

## Accessors

### datacenters

- get datacenters(): Datacenters

  #### Returns Datacenters

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:36

### health

- get health(): Health

  #### Returns Health

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:37

### namespaces

- get namespaces(): Namespaces

  #### Returns Namespaces

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:38

### runners

- get runners(): Runners

  #### Returns Runners

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:39

## Methods

### `Protected`_getAuthorizationHeader

- _getAuthorizationHeader(): Promise<string>

  #### Returns Promise<string>

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:232

### actorsCreate

- actorsCreate(
  request: Rivet.ActorsCreateRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.ActorsCreateResponse>

  If actor is created in the current datacenter:

  2 round trips:

  - namespace::ops::resolve_for_name_global
  - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)

  If actor is created in a different datacenter:

  3 round trips:

  - namespace::ops::resolve_for_name_global
  - POST /actors to remote datacenter
  - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)

  actor::get will always be in the same datacenter.

  #### Parameters

  - request: Rivet.ActorsCreateRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.ActorsCreateResponse>

  #### Example

      await client.actorsCreate({
              namespace: "namespace",
              crashPolicy: "restart",
              name: "name",
              runnerNameSelector: "runner_name_selector"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:102

### actorsDelete

- actorsDelete(
  actorId: string,
  request?: ActorsDeleteRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.ActorsDeleteResponse>

  2 round trip:

  - DELETE /actors/{}
  - [api-peer] namespace::ops::resolve_for_name_global

  #### Parameters

  - actorId: string
  - `Optional` request: ActorsDeleteRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.ActorsDeleteResponse>

  #### Example

      await client.actorsDelete("actor_id")

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:171

### actorsGetOrCreate

- actorsGetOrCreate(
  request: Rivet.ActorsGetOrCreateRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.ActorsGetOrCreateResponse>

  If actor exists

  2 round trips:

  - namespace::ops::resolve_for_name_global
  - GET /actors/{}

  If actor does not exist and is created in the current datacenter:

  2 round trips:

  - namespace::ops::resolve_for_name_global
  - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)

  If actor does not exist and is created in a different datacenter:

  3 round trips:

  - namespace::ops::resolve_for_name_global
  - POST /actors to remote datacenter
  - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)

  actor::get will always be in the same datacenter.

  ## Optimized Alternative Routes

  #### Parameters

  - request: Rivet.ActorsGetOrCreateRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.ActorsGetOrCreateResponse>

  #### Example

      await client.actorsGetOrCreate({
              namespace: "namespace",
              crashPolicy: "restart",
              key: "key",
              name: "name",
              runnerNameSelector: "runner_name_selector"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:142

### actorsList

- actorsList(
  request: ActorsListRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.ActorsListResponse>

  If key is some & `include_destroyed` is false

  2 round trips:

  - namespace::ops::resolve_for_name_global

  - GET /actors (multiple DCs based on actor IDs)

    This path is optimized because we can read the actor IDs fro the key directly from Epoxy with stale consistency to determine which datacenter the actor lives in. Under most circumstances, this means we don't need to fan out to all datacenters (like normal list does).

    The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If `include_destroyed` is true, we show all previous iterations of actors with the same key.

  Otherwise

  2 round trips:

  - namespace::ops::resolve_for_name_global
  - GET /actors (fanout)

  ## Optimized Alternative Routes

  #### Parameters

  - request: ActorsListRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.ActorsListResponse>

  #### Example

      await client.actorsList({
              namespace: "namespace"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:72

### actorsListNames

- actorsListNames(
  request: ActorsListNamesRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.ActorsListNamesResponse>

  2 round trips:

  - GET /actors/names (fanout)
  - [api-peer] namespace::ops::resolve_for_name_global

  #### Parameters

  - request: ActorsListNamesRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.ActorsListNamesResponse>

  #### Example

      await client.actorsListNames({
              namespace: "namespace"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:157

### runnerConfigsDelete

- runnerConfigsDelete(
  runnerName: string,
  request: RunnerConfigsDeleteRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.RunnerConfigsDeleteResponse>

  #### Parameters

  - runnerName: string
  - request: RunnerConfigsDeleteRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.RunnerConfigsDeleteResponse>

  #### Example

      await client.runnerConfigsDelete("runner_name", {
              namespace: "namespace"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:217

### runnerConfigsList

- runnerConfigsList(
  request: RunnerConfigsListRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.RunnerConfigsListResponse>

  #### Parameters

  - request: RunnerConfigsListRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.RunnerConfigsListResponse>

  #### Example

      await client.runnerConfigsList({
              namespace: "namespace"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:181

### runnerConfigsRefreshMetadata

- runnerConfigsRefreshMetadata(
  runnerName: string,
  request: RunnerConfigsRefreshMetadataRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.RunnerConfigsRefreshMetadataResponse>

  #### Parameters

  - runnerName: string
  - request: RunnerConfigsRefreshMetadataRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.RunnerConfigsRefreshMetadataResponse>

  #### Example

      await client.runnerConfigsRefreshMetadata("runner_name", {
              namespace: "namespace",
              body: {
                  "key": "value"
              }
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:231

### runnerConfigsServerlessHealthCheck

- runnerConfigsServerlessHealthCheck(
  request: Rivet.RunnerConfigsServerlessHealthCheckRequest,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.RunnerConfigsServerlessHealthCheckResponse>

  #### Parameters

  - request: Rivet.RunnerConfigsServerlessHealthCheckRequest
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.RunnerConfigsServerlessHealthCheckResponse>

  #### Example

      await client.runnerConfigsServerlessHealthCheck({
              namespace: "namespace",
              url: "url"
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:192

### runnerConfigsUpsert

- runnerConfigsUpsert(
  runnerName: string,
  request: Rivet.RunnerConfigsUpsertRequestBody,
  requestOptions?: RequestOptions,
  ): Promise<Rivet.RunnerConfigsUpsertResponse>

  #### Parameters

  - runnerName: string
  - request: Rivet.RunnerConfigsUpsertRequestBody
  - `Optional` requestOptions: RequestOptions

    Request-specific configuration.

  #### Returns Promise<Rivet.RunnerConfigsUpsertResponse>

  #### Example

      await client.runnerConfigsUpsert("runner_name", {
              namespace: "namespace",
              datacenters: {
                  "key": {}
              }
          })

  - Defined in engine/sdks/typescript/api-full/types/Client.d.ts:206