• Experimental

    API may change in future versions

    Publish events to a channel via HTTP request

    Parameters

    • channel: string

      channel path; <namespace>/<channel>

    • event: DocumentType | DocumentType[]

      JSON-serializable value or an array of values

    • Optional options: EventsOptions

      request overrides: authMode, authToken

    Returns Promise<void | PublishedEvent[]>

    void on success

    Example

    await events.post("default/channel", { some: "event" })
    

    Example

    // event batching
    await events.post("default/channel", [{ some: "event" }, { some: "event2" }])

    Example

    // authMode override
    await events.post("default/channel", { some: "event" }, { authMode: "userPool" })

    Throws

    on error