From 577a01edc3e3fc01d498449cd2f3fed514531de3 Mon Sep 17 00:00:00 2001 From: Rajat Saxena Date: Wed, 21 Oct 2026 20:14:44 +0530 Subject: [PATCH 1/2] chore(deps): bump @codelitdev/* to 0.4.2 --- apps/api/package.json | 12 ++++++------ apps/docs/package.json | 2 +- apps/web/package.json | 4 ++-- bun.lock | 32 ++++++++++++++++---------------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index 2468ac4..ac4b0f3 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -30,11 +30,11 @@ "@anthropic-ai/sdk": "^0.135.0", "@better-auth/cimd": "1.7.7", "@better-auth/oauth-provider": "1.7.7", - "@codelitdev/billing": "0.4.1", - "@codelitdev/mcp-server-kit": "0.4.1", - "@codelitdev/oauth-server-kit": "0.4.1", - "@codelitdev/observability": "0.4.1", - "@codelitdev/platform": "0.4.1", + "@codelitdev/billing": "0.4.2", + "@codelitdev/mcp-server-kit": "0.4.2", + "@codelitdev/oauth-server-kit": "0.4.2", + "@codelitdev/observability": "0.4.2", + "@codelitdev/platform": "0.4.2", "@modelcontextprotocol/node": "^2.0.0", "@modelcontextprotocol/server": "^2.0.0", "@sendlit/api-contract": "workspace:*", @@ -64,7 +64,7 @@ }, "devDependencies": { "@better-auth/core": "1.7.7", - "@codelitdev/platform-conformance": "0.4.1", + "@codelitdev/platform-conformance": "0.4.2", "@electric-sql/pglite": "0.5.8", "@modelcontextprotocol/client": "^2.0.0", "@sendlit/test-utils": "workspace:*", diff --git a/apps/docs/package.json b/apps/docs/package.json index 4187797..117aaff 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,7 +11,7 @@ "postinstall": "fumadocs-mdx" }, "dependencies": { - "@codelitdev/design-system": "0.4.1", + "@codelitdev/design-system": "0.4.2", "@sendlit/api-contract": "workspace:*", "@sendlit/email-blocks": "workspace:*", "@sendlit/email-editor": "workspace:*", diff --git a/apps/web/package.json b/apps/web/package.json index 416f93f..a337c7d 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,8 +12,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@codelitdev/design-system": "0.4.1", - "@codelitdev/observability": "0.4.1", + "@codelitdev/design-system": "0.4.2", + "@codelitdev/observability": "0.4.2", "@radix-ui/react-alert-dialog": "^1.1.18", "@radix-ui/react-dialog": "^1.1.18", "@radix-ui/react-label": "^2.1.11", diff --git a/bun.lock b/bun.lock index 944c47b..67f6cc0 100644 --- a/bun.lock +++ b/bun.lock @@ -19,11 +19,11 @@ "@anthropic-ai/sdk": "^0.135.0", "@better-auth/cimd": "1.7.7", "@better-auth/oauth-provider": "1.7.7", - "@codelitdev/billing": "0.4.1", - "@codelitdev/mcp-server-kit": "0.4.1", - "@codelitdev/oauth-server-kit": "0.4.1", - "@codelitdev/observability": "0.4.1", - "@codelitdev/platform": "0.4.1", + "@codelitdev/billing": "0.4.2", + "@codelitdev/mcp-server-kit": "0.4.2", + "@codelitdev/oauth-server-kit": "0.4.2", + "@codelitdev/observability": "0.4.2", + "@codelitdev/platform": "0.4.2", "@modelcontextprotocol/node": "^2.0.0", "@modelcontextprotocol/server": "^2.0.0", "@sendlit/api-contract": "workspace:*", @@ -53,7 +53,7 @@ }, "devDependencies": { "@better-auth/core": "1.7.7", - "@codelitdev/platform-conformance": "0.4.1", + "@codelitdev/platform-conformance": "0.4.2", "@electric-sql/pglite": "0.5.8", "@modelcontextprotocol/client": "^2.0.0", "@sendlit/test-utils": "workspace:*", @@ -73,7 +73,7 @@ "name": "@sendlit/docs", "version": "0.1.0", "dependencies": { - "@codelitdev/design-system": "0.4.1", + "@codelitdev/design-system": "0.4.2", "@sendlit/api-contract": "workspace:*", "@sendlit/email-blocks": "workspace:*", "@sendlit/email-editor": "workspace:*", @@ -102,8 +102,8 @@ "name": "@sendlit/web", "version": "0.1.0", "dependencies": { - "@codelitdev/design-system": "0.4.1", - "@codelitdev/observability": "0.4.1", + "@codelitdev/design-system": "0.4.2", + "@codelitdev/observability": "0.4.2", "@radix-ui/react-alert-dialog": "^1.1.18", "@radix-ui/react-dialog": "^1.1.18", "@radix-ui/react-label": "^2.1.11", @@ -415,19 +415,19 @@ "@changesets/write": ["@changesets/write@0.4.0", "", { "dependencies": { "@changesets/types": "^6.1.0", "fs-extra": "^7.0.1", "human-id": "^4.1.1", "prettier": "^2.7.1" } }, "sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q=="], - "@codelitdev/billing": ["@codelitdev/billing@0.4.1", "", { "dependencies": { "drizzle-orm": "^0.45.2", "nanoid": "^5.1.6", "zod": "^3.25.76" }, "peerDependencies": { "dodopayments": "^2.48.0" }, "optionalPeers": ["dodopayments"], "bin": { "codelit-billing": "bin/codelit-billing.js" } }, "sha512-xWd13SsfWcTumcM1wR4UAdX6U40wYGZzYOUmA5TweMuuRArOntr85M3lBJpUH63TO+r+LAh3PiZYdjldEu94fg=="], + "@codelitdev/billing": ["@codelitdev/billing@0.4.2", "", { "dependencies": { "drizzle-orm": "^0.45.2", "nanoid": "^5.1.6", "zod": "^3.25.76" }, "peerDependencies": { "dodopayments": "^2.48.0" }, "optionalPeers": ["dodopayments"], "bin": { "codelit-billing": "bin/codelit-billing.js" } }, "sha512-tjFaDsnTMh0hj3yYhhsBNOai7pzkv5xo0lslLh/TAqIXw3YzC3kUjQX7xryPkMGhDEnvZm5igtGVob6UEdofCw=="], - "@codelitdev/design-system": ["@codelitdev/design-system@0.4.1", "", { "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-s7z7BRa6u9O0Tlh3RJvLkc08+ojgAbtDjLf/RNB6GBnqnS7XrFM7ms1ZTZthcqFiI7+D4MVVVB6MdH958az5Ug=="], + "@codelitdev/design-system": ["@codelitdev/design-system@0.4.2", "", { "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-P8XpUW6/MDoyZ8cvVExGjhz7LtTEVFKMrBcjXcjwbPYGmDKeNj3PQkVP3V5sfYno5NQY/XFVcWR1f/vVsIIb7w=="], - "@codelitdev/mcp-server-kit": ["@codelitdev/mcp-server-kit@0.4.1", "", { "dependencies": { "@modelcontextprotocol/sdk": "^1.30.0", "zod": "^3.25.76" }, "peerDependencies": { "@codelitdev/platform": ">=0.4.1" } }, "sha512-itWudClAnlpHZgGnvCC3f3bNjHvaYlZlHKfUl6nbRVlumPs98CnutFjxieK6c+kexye4Aj1TyWcRtTxD+DfveQ=="], + "@codelitdev/mcp-server-kit": ["@codelitdev/mcp-server-kit@0.4.2", "", { "dependencies": { "@modelcontextprotocol/sdk": "^1.30.0", "zod": "^3.25.76" }, "peerDependencies": { "@codelitdev/platform": ">=0.4.2" } }, "sha512-1Wdd4ELa4zARXfa3Mpam7ZizHpfPC1XBjBHc5ny0Xi7uiojHLpU0pT7R94D0cCqeEnZvJntiBMzABgAyPS2esg=="], - "@codelitdev/oauth-server-kit": ["@codelitdev/oauth-server-kit@0.4.1", "", { "peerDependencies": { "@better-auth/oauth-provider": "^1.7.2", "better-auth": "^1.7.2", "express": "^4.21.2" } }, "sha512-mUOBtMlWLkOVS7sjdo7HgS/H0Nf5A3Nc+0pbt97HC6GK89YpSC3eaXKT6Ro4ta/bIphNbCgcSAl5lxIQf2SbFg=="], + "@codelitdev/oauth-server-kit": ["@codelitdev/oauth-server-kit@0.4.2", "", { "peerDependencies": { "@better-auth/oauth-provider": "^1.7.2", "better-auth": "^1.7.2", "express": "^4.21.2" } }, "sha512-3KD3J2etQqDrqkzyvew/aCqlYaA1ivXW/34aMLLlEMwUlf0a4FrzCfmalSqv2IIGeogz9kqZ/mnqrvqduBak1w=="], - "@codelitdev/observability": ["@codelitdev/observability@0.4.1", "", { "dependencies": { "pino": "^9.6.0" }, "peerDependencies": { "express": "^4.21.2", "posthog-js": "^1.200.0", "posthog-node": "^4.0.0" }, "optionalPeers": ["express", "posthog-js", "posthog-node"] }, "sha512-eGXXu5MHGZxYcm9VraOoZL8tN/yNEQkp9wC1j9LRgUOWJHN6Eiv/zhehM7Beecee5I9HKl7dX1zSfMuT5mFcHA=="], + "@codelitdev/observability": ["@codelitdev/observability@0.4.2", "", { "dependencies": { "pino": "^9.6.0" }, "peerDependencies": { "express": "^4.21.2", "posthog-js": "^1.200.0", "posthog-node": "^4.0.0" }, "optionalPeers": ["express", "posthog-js", "posthog-node"] }, "sha512-cPcXOkrp3G1uAC4Y8rt0GkmJ2vKw8ydL6j4sxL3FeSZBn083tiLVbL4FtHxICZqZMWA3OODom6xKA/L0EIYNxw=="], - "@codelitdev/platform": ["@codelitdev/platform@0.4.1", "", { "peerDependencies": { "@codelitdev/billing": ">=0.4.1", "drizzle-orm": "^0.45.2" }, "optionalPeers": ["@codelitdev/billing", "drizzle-orm"] }, "sha512-vHY32w9Jjmdm7CvIII1Z/Q4eTTsLmVGCpLiU8u8RvKEomFSUhaISrnTATh5gfq1xcWBzXsLj76XpUHoubZwX3g=="], + "@codelitdev/platform": ["@codelitdev/platform@0.4.2", "", { "peerDependencies": { "@codelitdev/billing": ">=0.4.2", "drizzle-orm": "^0.45.2" }, "optionalPeers": ["@codelitdev/billing", "drizzle-orm"] }, "sha512-eZd2UJ+aQ/AOCwRBhE5btI9gXEMOnuvash8GgWU4zSbO1Pu0Hk4cr4FhbL/VpqwASvgvzvlDnYm0es+LRo38HQ=="], - "@codelitdev/platform-conformance": ["@codelitdev/platform-conformance@0.4.1", "", { "peerDependencies": { "@codelitdev/platform": ">=0.4.1" } }, "sha512-rVebA+uBvzADIBVATVl42U/ifEuaNLJYfD7+vF71gBt0ms4wKi1wAwxLol6aopBSR2+DwL9+Mq//COZBSHTchQ=="], + "@codelitdev/platform-conformance": ["@codelitdev/platform-conformance@0.4.2", "", { "peerDependencies": { "@codelitdev/platform": ">=0.4.2" } }, "sha512-dvVvOrhP5cFe86FaI1Qf1sGAdS0NIeZasNrN9OBoTAIAeo+zM4WseRsXdhs4PGjYf5aD11ycZNGbgzrzg4KXdg=="], "@csstools/color-helpers": ["@csstools/color-helpers@5.1.0", "", {}, "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA=="], From 9725ddd5d50e80f6efdfa0034033b80099473882 Mon Sep 17 00:00:00 2001 From: Rajat Saxena Date: Wed, 21 Oct 2026 20:19:46 +0530 Subject: [PATCH 2/2] feat(observability): adopt Platform 0.4.2 and send real ids to PostHog platform-cli sync moves the conformance workflow to 0.4.2. 0.4.2 batches and retries telemetry and adds contextPolicy.identifierKeys; list SendLit's id properties there so team_id, organization_id and other UUIDs reach PostHog instead of [redacted-token]. The hosted sign-in page now shows signup refusals (codelitdev/platform#11). --- .codelit-platform.json | 4 ++-- .github/workflows/platform-conformance.yml | 2 +- apps/api/src/observability/index.test.ts | 21 +++++++++++++++++++++ apps/api/src/observability/instance.ts | 21 ++++++++++++++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/.codelit-platform.json b/.codelit-platform.json index c2c9b6d..ccebde2 100644 --- a/.codelit-platform.json +++ b/.codelit-platform.json @@ -4,7 +4,7 @@ "name": "SendLit", "slug": "sendlit" }, - "cliVersion": "0.4.1", + "cliVersion": "0.4.2", "capabilities": [ "auth", "mcp", @@ -12,7 +12,7 @@ "billing" ], "managedFiles": { - ".github/workflows/platform-conformance.yml": "7e1a5fa61c16447cc645aee556a101b62b70346322ff7706095df94e6fe7cbd1" + ".github/workflows/platform-conformance.yml": "939bf5686a4433b93153ca2b919ba77251c7bf70b17b269cde02606be41535f4" }, "productOwnedGlobs": [ "apps/**", diff --git a/.github/workflows/platform-conformance.yml b/.github/workflows/platform-conformance.yml index 954eae5..de747b2 100644 --- a/.github/workflows/platform-conformance.yml +++ b/.github/workflows/platform-conformance.yml @@ -23,7 +23,7 @@ jobs: if: ${{ !hashFiles('bun.lock') }} - run: bun install --frozen-lockfile # Pinned to the CLI release that wrote this file. `sync` moves it. - - run: bunx @codelitdev/platform-cli@0.4.1 doctor + - run: bunx @codelitdev/platform-cli@0.4.2 doctor - run: bun run --filter "*/api" check:drift # Fails when the API package has no `test:conformance` script. - run: bun run --filter "*/api" test:conformance diff --git a/apps/api/src/observability/index.test.ts b/apps/api/src/observability/index.test.ts index 53318bd..411d861 100644 --- a/apps/api/src/observability/index.test.ts +++ b/apps/api/src/observability/index.test.ts @@ -81,6 +81,27 @@ describe("SendLit observability", () => { expect(properties.email).toBeUndefined(); }); + it("sends id properties as they are instead of masking them as tokens", () => { + const client = fakeClient(); + const events = createSendLitObservability(env, { client, purpose: "events" }); + const teamId = "01a15ed4-d3f2-798f-b6fa-cbedeb854b54"; + + events.captureEvent({ + event: "team_paused_for_review", + source: "abuse.flags", + subjectId: teamId, + properties: { + team_id: teamId, + organization_id: teamId, + reason: "content_review", + }, + }); + + const [{ properties }] = client.capture.mock.calls[0]; + expect(properties.team_id).toBe(teamId); + expect(properties.organization_id).toBe(teamId); + }); + it("dedupes identical errors within the TTL window", () => { const client = fakeClient(); const observability = createSendLitObservability(env, { client }); diff --git a/apps/api/src/observability/instance.ts b/apps/api/src/observability/instance.ts index e472215..faa34d5 100644 --- a/apps/api/src/observability/instance.ts +++ b/apps/api/src/observability/instance.ts @@ -62,6 +62,22 @@ const PROPERTY_ALLOWLIST = new Set([ "scan_mode", ]); +/** Allowlisted keys that hold opaque record ids. They skip the package's + * long-token mask, which would otherwise hide every UUID. */ +const IDENTIFIER_KEYS = new Set([ + "team_id", + "user_id", + "contact_id", + "sequence_id", + "ongoing_sequence_id", + "template_id", + "segment_id", + "email_id", + "job_id", + "organization_id", + "form_id", +]); + /** * `purpose: "events"` builds the instance for product analytics. The package * dedupes and rate-caps captures per source, which suits errors but would drop @@ -94,7 +110,10 @@ export function createSendLitObservability( } : {}), }, - contextPolicy: { propertyAllowlist: PROPERTY_ALLOWLIST }, + contextPolicy: { + propertyAllowlist: PROPERTY_ALLOWLIST, + identifierKeys: IDENTIFIER_KEYS, + }, ...(forEvents ? { dedupeTtlMs: 0, dedupeMaxKeys: 1, perSourceCap: Number.POSITIVE_INFINITY } : {