UNPKG

@trycourier/courier-js

Version:

A browser-safe API wrapper

19 lines (18 loc) 891 B
import { CourierUserAgent as ICourierUserAgent } from '../types/courier-user-agent'; /** Client info reportable to the Courier backend in WebSocket and HTTP requests. */ export declare class CourierUserAgent { private readonly clientId; private readonly sdkName; private readonly sdkVersion; /** * Create User Agent info * @param clientId client ID for this session * @param sdkName identifier of the SDK making requests to the Courier backend * @param sdkVersion version of the SDK making requests to the Courier backend */ constructor(clientId: string, sdkName: string, sdkVersion: string); /** Get the telemetry payload as a JSON-serializable object. */ getUserAgentInfo(): ICourierUserAgent; /** Get the telemetry payload as a comma-separated string, where keys and values are joined by `=`. */ toHttpHeaderValue(): string; }