Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventGridPublisherClient<T>

Package version

Client class for publishing events to the Event Grid Service.

Type parameters

Hierarchy

  • EventGridPublisherClient

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates an instance of EventGridPublisherClient which sends events using the Event Grid Schema.

    Example usage:

    import { EventGridPublisherClient, AzureKeyCredential } from "@azure/eventgrid";
    
    const client = new EventGridPublisherClient(
       "<service endpoint>",
       "EventGrid",
       new AzureKeyCredential("<api key>")
    );

    Parameters

    • endpointUrl: string

      The URL to the Event Grid endpoint, e.g. https://eg-topic.westus2-1.eventgrid.azure.net/api/events.

    • inputSchema: T

      The schema that the Event Grid endpoint is configured to accept. One of "EventGrid", "CloudEvent", or "Custom".

    • credential: KeyCredential | SASCredential | TokenCredential

      Used to authenticate requests to the service.

    • Default value options: EventGridPublisherClientOptions = {}

      Used to configure the Event Grid Client.

    Returns EventGridPublisherClient

Properties

apiVersion

apiVersion: string

The version of the Even Grid service.

endpointUrl

endpointUrl: string

The URL to the Event Grid endpoint.

Methods

send

  • send(events: InputSchemaToInputTypeMap[T][], options?: InputSchemaToOptionsTypeMap[T]): Promise<void>
  • Sends events to a topic.

    Parameters

    • events: InputSchemaToInputTypeMap[T][]

      The events to send. The events should be in the schema used when constructing the client.

    • Default value options: InputSchemaToOptionsTypeMap[T] = {}

      Options to control the underlying operation.

    Returns Promise<void>

Generated using TypeDoc