File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @flagix/js-sdk " : minor
3+ ---
4+
5+ migrated internal tracking and evaluation endpoints to a generic /api/sync path. This change is to improve the SDK reliability by bypassing aggressive tracking filters in browser privacy extensions and ad-blockers
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import flagRoutes from "@/routes/flag/route";
88import flagConfigRoutes from "@/routes/flag-config/route" ;
99import projectRoutes from "@/routes/project/route" ;
1010import sseRoutes from "@/routes/sse/route" ;
11- import trackRoutes from "@/routes/track /route" ;
11+ import trackRoutes from "@/routes/sync /route" ;
1212
1313const createApp = ( ) : Express => {
1414 const app : Express = express ( ) ;
@@ -23,7 +23,10 @@ const createApp = (): Express => {
2323
2424 app . use ( "/api/flag-config" , flagConfigRoutes ) ;
2525 app . use ( "/api/sse" , sseRoutes ) ;
26- app . use ( "/api/track" , trackRoutes ) ;
26+
27+ // this route ideally should be `track` but is named `sync` because ad-blockers block routes with "track" in them
28+ // the route handles tracking events from the SDK
29+ app . use ( "/api/sync" , trackRoutes ) ;
2730
2831 app . use ( requireAuth ) ;
2932
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { CorsOptionsDelegate } from "cors";
22import type { Request } from "express" ;
33import { env } from "@/config/env" ;
44
5- const SDK_PREFIXES = [ "/api/flag-config" , "/api/track " , "/api/sse" ] ;
5+ const SDK_PREFIXES = [ "/api/flag-config" , "/api/sync " , "/api/sse" ] ;
66const ALLOWED_ADMIN_ORIGINS = [ env . FRONTEND_URL , "http://localhost:3000" ] ;
77
88export const corsOptions : CorsOptionsDelegate = ( req , callback ) => {
File renamed without changes.
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ export class FlagixClient {
412412 properties ?: Record < string , unknown > ,
413413 contextOverrides ?: EvaluationContext
414414 ) : void {
415- const url = `${ this . apiBaseUrl } /api/track /event` ;
415+ const url = `${ this . apiBaseUrl } /api/sync /event` ;
416416
417417 const finalContext = { ...this . context , ...contextOverrides } ;
418418 const distinctId = resolveIdentifier ( finalContext ) ;
@@ -466,7 +466,7 @@ export class FlagixClient {
466466 result : FlagVariation ,
467467 context : EvaluationContext
468468 ) : void {
469- const url = `${ this . apiBaseUrl } /api/track /evaluation` ;
469+ const url = `${ this . apiBaseUrl } /api/sync /evaluation` ;
470470
471471 const distinctId = resolveIdentifier ( context ) ;
472472
You can’t perform that action at this time.
0 commit comments