UNPKG

@trycourier/courier-js

Version:

A browser-safe API wrapper

33 lines (32 loc) 1.18 kB
import { CourierTrackingEvent } from '../types/tracking-event'; import { Client } from './client'; export declare class TrackingClient extends Client { /** * Post an inbound courier event * @param event - The event type: Example: "New Order Placed" * @param messageId - The message ID * @param type - The type of event: Available options: "track" * @param properties - The properties of the event * @returns Promise resolving to the message ID * @see https://www.courier.com/docs/reference/inbound/courier-track-event */ postInboundCourier(props: { event: string; messageId: string; type: 'track'; properties?: Record<string, any>; }): Promise<{ messageId: string; }>; /** * Post a tracking URL event * These urls are found in messages sent from Courier * @param url - The URL to post the event to * @param event - The event type: Available options: "click", "open", "unsubscribe" * @returns Promise resolving when the event is posted */ postTrackingUrl(props: { url: string; event: CourierTrackingEvent; }): Promise<void>; }