import { Condition } from './condition' ; import { removeAbTestParameter } from './query' ; import { ConsoleTracking , Tracking } from './tracking' ; import { CookiePersister , UserSessionPersister } from './userSessionPersister' ; export interface Config { cookieName : string ; globalCondition : Condition ; param testName param variationName onVariationChange : ( testName ? : string , variationName ? : string ) => void ; sessionPersister : UserSessionPersister ; tracking : Tracking ; uiCondition : Condition ; userSessionDaysToLive : number ; } const config = { cookieName : 'skiftABTest' , globalCondition : ( ) => true , onVariationChange : ( ) => { const previousSearch = location . search ; const newSearch = removeAbTestParameter ( location . search ) ; if ( previousSearch !== newSearch ) { location . search = newSearch ; } else { location . reload ( ) ; } } , sessionPersister : new CookiePersister ( ) , tracking : new ConsoleTracking ( ) , uiCondition : ( ) => false , userSessionDaysToLive : 3 , } ; export default config ;