import { ContentsquareModule } from '../core/nativeModules'; /** * Sends a user identity to CSQ tracking services. This identity is immediately hashed so no PII can ever be accessed. * * @param {string} identity Sends a user identity to CSQ tracking services. This identity is immediately hashed so no PII can ever be accessed. */ export const identify = (identity: string): void => { ContentsquareModule.identify(identity); }; /** * Opt user IN Contentsquare tracking program. * This allows Contentsquare SDK gather user behaviors while navigating through the app. */ export const optIn = (): void => { ContentsquareModule.optIn(); }; /** * Opt user OUT of the Contentsquare tracking program. * This will stop Contentsquare SDK from gathering any further user behavior while navigating * around the app. */ export const optOut = (): void => { ContentsquareModule.optOut(); }; export const resetIdentity = (): void => { ContentsquareModule.resetIdentity(); }; /** * Sends a User Identifier to Contentsquare tracking services. This identifier is immediately * hashed so no PII can ever be accessed. * * @param {string} userIdentifier The user identifier should be max 100 characters long. */ export const sendUserIdentifier = (userIdentifier: string): void => { if (typeof userIdentifier === 'string') { ContentsquareModule.sendUserIdentifier(userIdentifier); } else { console.error('The User Identifier must be of string data type.'); } };