@squidcloud/client
    Preparing search index...

    Class EventsClient

    EventsClient provides methods for emitting generic events that are handled by backend functions declared with the @eventHandler decorator.

    Index

    Methods

    Methods

    • Emits a generic event delivered to every subscriber declared with @eventHandler for the same event type. Events are delivered durably/at-least-once with no ordering guarantee, so handlers should be idempotent and order-independent. Resolves once the event is enqueued, not once subscribers have handled it.

      Requires API key authentication — events are emitted only by trusted server-side code, so calls authenticated with a user token are rejected.

      Type Parameters

      • T

      Parameters

      • event: TriggerEvent<T>

        The event to emit, with a unique id, a type, and a payload.

      Returns Promise<void>