Skip to content

Commit

Permalink
Add eventsTracker staging url
Browse files Browse the repository at this point in the history
  • Loading branch information
jrlarano committed Sep 18, 2024
1 parent 65e49f1 commit 39a33b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/config-defaults.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const coreUrl = 'https://squid-api.tjek.com';
export const coreUrlStaging = 'https://squid-api.tjek-staging.com';
export const eventsTrackUrl = 'https://wolf-api.tjek.com/sync';
export const eventsTrackUrlStaging = 'https://wolf-api.tjek-staging.com/sync';
10 changes: 8 additions & 2 deletions lib/sgn-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import * as clientLocal from './storage/client-local';
import './stylus/sgn.styl';
import {error, isBrowser} from './util';
import {coreUrlStaging} from './config-defaults';
import {coreUrlStaging, eventsTrackUrlStaging} from './config-defaults';

export const config = new Config();
config.bind('change', (changedAttributes) => {
Expand Down Expand Up @@ -67,7 +67,13 @@ if (isBrowser()) {

if (trackId) scriptConfig.eventTracker = new Tracker({trackId});

if (environment === 'staging') scriptConfig.coreUrl = coreUrlStaging;
if (environment === 'staging') {
scriptConfig.coreUrl = coreUrlStaging;
scriptConfig.eventTracker = new Tracker({
trackId,
eventsTrackUrl: eventsTrackUrlStaging
});
}

config.set(scriptConfig);

Expand Down

0 comments on commit 39a33b0

Please sign in to comment.