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

# Actor Stub

> The client handle returned by idFromName / newUniqueId. Calling a method on the stub is an RPC to that one actor instance.

An `ActorStub` is the client handle returned by [`idFromName` / `newUniqueId`](/docs/edge-compute/stateful-actors/api-reference/namespace). Calling a method on it is an RPC to that one actor instance.

```ts theme={null}
interface ActorStub {
  readonly id: string;                       // the name passed to idFromName
  fetch(req: Request): Promise<Response>;    // HTTP-style entry (see Base Class fetch)
  // + your subclass's public methods — typed via `telnyx-edge types` or by hand, below
}
```

`telnyx-edge types` generates the narrowing for every `[[actors]]` binding in
`telnyx.toml` — a `telnyx-env.d.ts` that types `env.<BINDING>` against your class's
public method shape. To hand-roll it instead (also the path for a
[shared-actor reference](/docs/edge-compute/stateful-actors/shared-actors), which
ships no local class for codegen to read):

```ts theme={null}
import { type ActorNamespace, type ActorStub, type IdFromNameOptions } from "@telnyx/edge-runtime";

type AccountStub = ActorStub & Pick<Account, "deposit" | "debit" | "balance">;

interface AccountNamespace extends ActorNamespace {
  idFromName(name: string, options?: IdFromNameOptions): AccountStub;
}

interface Env { ACCOUNT: AccountNamespace }
```

## Related

* [Actor Namespace](/docs/edge-compute/stateful-actors/api-reference/namespace) — produces stubs
* [Base Class](/docs/edge-compute/stateful-actors/api-reference/base) — the `fetch` handler a stub can call
