website/src/content/docs/actors/metadata.mdx
Get the unique instance ID of the actor:
<CodeSnippet file="examples/docs/actors-metadata/actor-id.ts" />Get the actor type name:
<CodeSnippet file="examples/docs/actors-metadata/actor-name.ts" />This is useful when you need to know which actor type is running, especially if you have generic utility functions that are shared between different actor implementations.
Get the actor key used to identify this actor instance:
<CodeSnippet file="examples/docs/actors-metadata/actor-key.ts" />The key is used to route requests to the correct actor instance and can include parameters passed when creating the actor.
Learn more about using keys for actor addressing and configuration in the keys documentation.
Region can be accessed from the context object via c.region.
<Warning>c.region is only supported on Rivet at the moment.</Warning>
ActorDefinition - Interface for defining metadataCreateOptions - Options for creating an actor, including region and input