Type Alias: ConnectIntegration()
ConnectIntegration = (
integration
) =>void
Describes the contract that an external API tracking script must implement so that it can be imported and executed by the integration. The API script must be hosted on the remote server with CORS enabled.
Parameters
integration
Returns
void
Examples
import { IntegrationEvent } from '@glomex/integration';
export const connectIntegration: ConnectIntegration = (integration) => {
integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => {
console.log('play', integration.content);
});
};
export const connectIntegration = (integration) => {
const { IntegrationEvent } = integration.constructor;
integration.addEventListener(IntegrationEvent.CONTENT_PLAY, () => {
console.log('play', integration.content);
});
};
Last updated on