Actors
The Dapr JavaScript SDK lets Node.js applications host virtual actors, call actors through proxies or by method name, manage actor state, and schedule timers and durable reminders.
These guides target @dapr/dapr 3.19.0 or later. Use a supported Node.js LTS release and a Dapr runtime that supports the APIs you use. The how-to guide uses HTTP actor hosting and a local Dapr environment.
Choose a guide
| Guide | Learn how to |
|---|---|
| Run and use virtual actors | Create a contract, implement an actor, configure a state store, and run a host and client |
| Author and host actors | Register types, use lifecycle hooks, and configure the actor runtime |
| Call actors | Choose actor identities, build proxies, invoke methods dynamically, and understand serialization |
| Manage actor state | Read, update, remove, cache, and explicitly save actor state |
| Use timers and reminders | Schedule callbacks, retrieve and list reminders, and perform scoped or type-wide cleanup |
Protocol and runtime support
The application protocol and the protocol used to call the sidecar are separate choices.
| Capability | HTTP | gRPC |
|---|---|---|
Host JavaScript actors with DaprServer | Supported | Not implemented |
| Invoke actor methods through a proxy or the lower-level actor client | Supported | Supported |
| Read and transact actor state; register and unregister timers and individual reminders | Supported | Supported |
Retrieve an individual reminder with getActorReminder | Supported | Supported |
List reminders for one actor with listActorReminders | Dapr 1.19+ | Dapr 1.17+ |
| List reminders for every instance of an actor type | Not supported | Dapr 1.17+ |
Delete reminders in bulk with unregisterActorRemindersByType | Not supported | Dapr 1.17+ |
A gRPC client can call actors hosted by an HTTP application. It does not require a gRPC actor host. JavaScript actor hosting does not implement the runtime’s app-initiated actor streams.
The SDK does not expose every feature of the runtime’s Actors API. For example, this SDK version has no high-level timer retrieval/listing methods or reminder overwrite and failurePolicy options. See the individual guides for serialization and reentrancy limitations.
Registering actors
Call await server.actor.init() and await server.actor.registerActor(YourActor) before await server.start(). Registration advertises an actor type; it does not create every actor instance. Dapr activates instances on demand.
See author and host actors for registration and configuration, or follow the complete example.