Skip to content

Commit

Permalink
Add staging URL for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrlarano committed Sep 19, 2024
1 parent 286e9e5 commit d59116e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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';
9 changes: 6 additions & 3 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 @@ -71,8 +71,11 @@ if (isBrowser()) {
scriptConfig.coreUrl = coreUrlStaging;
}

if (trackId && !isStaging) {
scriptConfig.eventTracker = new Tracker({trackId});
if (trackId) {
scriptConfig.eventTracker = new Tracker({
trackId,
...(isStaging && {eventsTrackUrl: eventsTrackUrlStaging})
});
}

config.set(scriptConfig);
Expand Down

0 comments on commit d59116e

Please sign in to comment.