diff --git a/docker-compose.yml b/docker-compose.yml index 7cbbaac..8912da5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,7 @@ services: - DATABASE_URL=postgresql://linkforty:secret_password_prod@postgres-prod:5432/linkforty_prod?sslmode=disable - REDIS_URL=redis://redis-prod:6379 - PORT=3000 + - TRUST_PROXY=1 depends_on: - postgres-prod - redis-prod @@ -88,6 +89,7 @@ services: - DATABASE_URL=postgresql://linkforty:secret_password_sandbox@postgres-sandbox:5432/linkforty_sandbox?sslmode=disable - REDIS_URL=redis://redis-sandbox:6379 - PORT=3001 + - TRUST_PROXY=1 depends_on: - postgres-sandbox - redis-sandbox diff --git a/src/lib/fingerprint.test.ts b/src/lib/fingerprint.test.ts index af3f75a..846d4be 100644 --- a/src/lib/fingerprint.test.ts +++ b/src/lib/fingerprint.test.ts @@ -442,6 +442,10 @@ describe('recordInstallEvent', () => { pid: 'recommend_user', u: 'abc', }); + expect(result.deepLinkData.customParameters).toEqual({ + pid: 'recommend_user', + u: 'abc', + }); expect(result.deepLinkData.clickQueryParameters).toEqual({ u: 'abc' }); }); }); diff --git a/src/lib/fingerprint.ts b/src/lib/fingerprint.ts index b5a7055..c0da968 100644 --- a/src/lib/fingerprint.ts +++ b/src/lib/fingerprint.ts @@ -691,6 +691,8 @@ export async function recordInstallEvent( utmParameters: link.utm_parameters, targetingRules: link.targeting_rules, deepLinkParameters, + // Backward-compatible alias for older SDKs expecting `customParameters`. + customParameters: deepLinkParameters, clickQueryParameters: clickQueryParams, clickedAt: match.clickedAt, confidenceScore: match.confidenceScore,