Skip to content

Commit

Permalink
Update client config endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tanyav2 committed Nov 9, 2024
1 parent 5a73174 commit a8b335e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions e2e/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test.describe('Tinfoil Analytics', () => {

test('handles configuration fetch failure', async ({ page }) => {
// Mock failed configuration fetch
await page.route('**/accounts/*/analytics:config', route => {
await page.route('**/domains/*/config', route => {
route.abort();
});

Expand All @@ -55,7 +55,7 @@ test.describe('Tinfoil Analytics', () => {

test('does not track events multiple times due to caching', async ({ page }) => {
// Mock configuration with 'visit' event
await page.route('**/accounts/*/analytics:config', route => {
await page.route('**/domains/*/config', route => {
route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function getConfig(
endpoint: string = DEFAULT_CONFIG_ENDPOINT
): Promise<GlobalConfig | null> {
try {
const url = new URL(`accounts/${domain}/analytics:config`, endpoint);
const url = new URL(`domains/${domain}/config`, endpoint);
logger.log(`Fetching global config from URL: ${url}`);
const response = await fetch(url.toString());

Expand Down

0 comments on commit a8b335e

Please sign in to comment.