import 'cross-fetch/polyfill' ; import { analytics , EventData , EventOptions } from '@splitbee/core' ; export class SplitbeeAnalytics { private projectId ? : string ; constructor ( projectId ) { this . projectId = projectId ; } public track = async ( { userId , event , data , } , options ? ) => { await analytics . track ( { event , data , options , context : { projectId : this . projectId , userId , uid : options ?. __uid } } ) ; } ; public page = async ( { page , data , userId , } , options ? ) => { await analytics . page ( { page , data , options , context : { projectId : this . projectId , userId , uid : options ?. __uid } } ) ; } ; public user = { set : async ( { userData , userId , } , options ? ) => { await analytics . identify ( { userData , context : { projectId : this . projectId , userId , uid : options ?. __uid } } ) ; } } ; }