# Interface ClientRaw

Client for managing & connecting to actors.

#### Template: A

The actors map type that defines the available actors.

#### See

& Manage Actors

interface ClientRaw {
"[ACTOR_CONNS_SYMBOL]": Set<ActorConnRaw>;
"[CREATE_ACTOR_CONN_PROXY]"<AD extends AnyActorDefinition>(
conn: ActorConnRaw,
): ActorConn<AD>;
create<AD extends AnyActorDefinition>(
name: string,
key?: string | string[],
opts?: CreateOptions,
): Promise<ActorHandle<AD>>;
dispose(): Promise<void>;
get<AD extends AnyActorDefinition>(
name: string,
key?: string | string[],
opts?: GetWithIdOptions,
): ActorHandle<AD>;
getForId<AD extends AnyActorDefinition>(
name: string,
actorId: string,
opts?: GetWithIdOptions,
): ActorHandle<AD>;
getOrCreate<AD extends AnyActorDefinition>(
name: string,
key?: string | string[],
opts?: GetOrCreateOptions,
): ActorHandle<AD>;
}

- Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:158

##### Index

### Properties

[ACTOR_CONNS_SYMBOL]

### Methods

[CREATE_ACTOR_CONN_PROXY]
create
dispose
get
getForId
getOrCreate

## Properties

### [ACTOR_CONNS_SYMBOL]

"[ACTOR_CONNS_SYMBOL]": Set<ActorConnRaw> = ...

- Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:161

## Methods

### [CREATE_ACTOR_CONN_PROXY]

- "[CREATE_ACTOR_CONN_PROXY]"<AD extends AnyActorDefinition>(
  conn: ActorConnRaw,
  ): ActorConn<AD>

  #### Type Parameters

  - AD extends AnyActorDefinition

  #### Parameters

  - conn: ActorConnRaw

  #### Returns ActorConn<AD>

  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:352

### create

- create<AD extends AnyActorDefinition>(
  name: string,
  key?: string | string[],
  opts?: CreateOptions,
  ): Promise<ActorHandle<AD>>

  Creates a new actor with the provided key and returns a stateless handle to it. Resolves the actor ID and returns a handle with getForId query.

  #### Type Parameters

  - AD extends AnyActorDefinition

    The actor class that this handle is for.

  #### Parameters

  - name: string

    The name of the actor.

  - `Optional` key: string | string[]

    The key to identify the actor. Can be a single string or an array of strings.

  - `Optional` opts: CreateOptions

    Options for creating the actor (excluding name and key).

  #### Returns Promise<ActorHandle<AD>>

  - A promise that resolves to a handle to the actor.
  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:290

### dispose

- dispose(): Promise<void>

  Disconnects from all actors.

  #### Returns Promise<void>

  A promise that resolves when all connections are closed.

  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:369

### get

- get<AD extends AnyActorDefinition>(
  name: string,
  key?: string | string[],
  opts?: GetWithIdOptions,
  ): ActorHandle<AD>

  Gets a stateless handle to a actor by its key, but does not create the actor if it doesn't exist.

  #### Type Parameters

  - AD extends AnyActorDefinition

    The actor class that this handle is for.

  #### Parameters

  - name: string

    The name of the actor.

  - `Optional` key: string | string[]

    The key to identify the actor. Can be a single string or an array of strings.

  - `Optional` opts: GetWithIdOptions

    Options for getting the actor.

  #### Returns ActorHandle<AD>

  - A handle to the actor.
  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:216

### getForId

- getForId<AD extends AnyActorDefinition>(
  name: string,
  actorId: string,
  opts?: GetWithIdOptions,
  ): ActorHandle<AD>

  Gets a stateless handle to a actor by its ID.

  #### Type Parameters

  - AD extends AnyActorDefinition

    The actor class that this handle is for.

  #### Parameters

  - name: string

    The name of the actor.

  - actorId: string

    The ID of the actor.

  - `Optional` opts: GetWithIdOptions

    Options for getting the actor.

  #### Returns ActorHandle<AD>

  - A handle to the actor.
  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:184

### getOrCreate

- getOrCreate<AD extends AnyActorDefinition>(
  name: string,
  key?: string | string[],
  opts?: GetOrCreateOptions,
  ): ActorHandle<AD>

  Gets a stateless handle to a actor by its key, creating it if necessary.

  #### Type Parameters

  - AD extends AnyActorDefinition

    The actor class that this handle is for.

  #### Parameters

  - name: string

    The name of the actor.

  - `Optional` key: string | string[]

    The key to identify the actor. Can be a single string or an array of strings.

  - `Optional` opts: GetOrCreateOptions

    Options for getting the actor.

  #### Returns ActorHandle<AD>

  - A handle to the actor.
  - Defined in rivetkit-typescript/packages/rivetkit/src/client/client.ts:251