More

Metadata

Metadata provides information about the currently running actor. Metadata can be accessed from this._metadata.

For example:

export default class ChatRoom extends Actor {
  // Internal method used to get the channel ID. Returns `random` for this example.
  #getChannelId(rpc: Rpc<ChatRoom>): string {
    return this._metadata.actor.tags['channel'];
  }
}

Properties

actor

  • id: The unique identifier for the actor.
  • tags: A collection of key-value pairs associated with the actor. See Create & Manage Actors for more information.
  • createdAt: The date when the actor was created.

region

build

  • id: The unique identifier for the currently running build.

project

  • id: The unique identifier for the project.
  • slug: A human-readable identifier for the project.

environment

  • id: The unique identifier for the environment.
  • slug: A human-readable identifier for the environment.

cluster

This is only relevant if running multiple dedicated clusters.

  • id: The unique identifier for the cluster.