@twilio/voice-sdk
Version:
Twilio's JavaScript Voice SDK
30 lines (29 loc) • 1.34 kB
TypeScript
import { EventEmitter } from 'events';
/**
* Builds Endpoint Analytics (EA) event payloads and sends them to
* the EA server.
* @constructor
* @param {String} productName - Name of the product publishing events.
* @param {String} token - The JWT token to use to authenticate with
* the EA server.
* @param {EventPublisher.Options} options
* @property {Boolean} isEnabled - Whether or not this publisher is publishing
* to the server. Currently ignores the request altogether, in the future this
* may store them in case publishing is re-enabled later. Defaults to true.
*/
/**
* @typedef {Object} EventPublisher.Options
* @property {Object} [metadata=undefined] - A publisher_metadata object to send
* with each payload.
* @property {String} [host='eventgw.twilio.com'] - The host address of the EA
* server to publish to.
* @property {Object|Function} [defaultPayload] - A default payload to extend
* when creating and sending event payloads. Also takes a function that
* should return an object representing the default payload. This is
* useful for fields that should always be present when they are
* available, but are not always available.
*/
declare class EventPublisher extends EventEmitter {
constructor(productName: any, token: any, options: any);
}
export default EventPublisher;