-
Couldn't load subscription status.
- Fork 402
feat(clerk-js): Add TelemetryCollector instance to backend client #2134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| * Determines whether or not events will be logged to the console. | ||
| * The publishableKey to associate with the collected events. | ||
| */ | ||
| verbose?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verbose is now unused with the debug option.
* feat(clerk-js): Spike out telemetry collection * feat(clerk-js): Add sampling rate and verbose option * feat(shared): Move TelemtryCollector into shared, make it isomorphic * feat(nextjs): Add telemtry collection for authMiddleware * feat(shared): Support passing multiple events to the telemetry endpoint * feat(shared): Abstract fetch into sendEvent * feat(shared): Refactor SDK metadata handling to get accurate value * feat(shared): Update endpoint, don't use no-cors * fix(nextjs): Fix merge conflict * feat(shared): Add batching to the telemetry collector * feat(shared): Add opt-out support for SDK telemetry (#2099) * feat(clerk-js): Add TelemetryCollector instance to backend client (#2134) * chore(repo): Add changeset * fix(shared): Fix tests that rely on fetch * feat(shared): Set production endpoint * feat(clerk-js): Make telemtry public, expose via isomorphicClerk * feat(shared): Add doc on the TelemetryCollector * feat(clerk-js): Support telemetry: false as a way to disable telemetry * chore(shared): Tweak comment * chore(shared): Tweak comment * fix(clerk-sdk-node): Add PACKAGE_ constants for tests * fix(fastify): Define PACKAGE_ constants in test environment * feat(shared): Refactor telemetry instrumentation to rely on helpers * feat(shared): Add telemetry notice * feat(shared): Add postinstall script * chore(shared): Add word * chore(shared): Swallow errors in postinstall * chore(repo): Allow scripts directory in subpaths-workaround * feat(shared): Adjust types to enforce the event structure from event factory methods * chore(shared): Simplify telemetry.record() API
* feat(clerk-js): Spike out telemetry collection * feat(clerk-js): Add sampling rate and verbose option * feat(shared): Move TelemtryCollector into shared, make it isomorphic * feat(nextjs): Add telemtry collection for authMiddleware * feat(shared): Support passing multiple events to the telemetry endpoint * feat(shared): Abstract fetch into sendEvent * feat(shared): Refactor SDK metadata handling to get accurate value * feat(shared): Update endpoint, don't use no-cors * fix(nextjs): Fix merge conflict * feat(shared): Add batching to the telemetry collector * feat(shared): Add opt-out support for SDK telemetry (#2099) * feat(clerk-js): Add TelemetryCollector instance to backend client (#2134) * chore(repo): Add changeset * fix(shared): Fix tests that rely on fetch * feat(shared): Set production endpoint * feat(clerk-js): Make telemtry public, expose via isomorphicClerk * feat(shared): Add doc on the TelemetryCollector * feat(clerk-js): Support telemetry: false as a way to disable telemetry * chore(shared): Tweak comment * chore(shared): Tweak comment * fix(clerk-sdk-node): Add PACKAGE_ constants for tests * fix(fastify): Define PACKAGE_ constants in test environment * feat(shared): Refactor telemetry instrumentation to rely on helpers * feat(shared): Add telemetry notice * feat(shared): Add postinstall script * chore(shared): Add word * chore(shared): Swallow errors in postinstall * chore(repo): Allow scripts directory in subpaths-workaround * feat(shared): Adjust types to enforce the event structure from event factory methods * chore(shared): Simplify telemetry.record() API
Description
Adds a
TelemetryCollectorinstance to the clerk backend client to allow collection in server environments. I also updated the collector to accept an instance'ssecretKey. Ultimately we do only collect the first 16 characters of the secret key to allow for later analysis.I'm not entirely happy with piggybacking off of the backend client like this, but for now I think it's an easy way to consistently handle server-side telemetry across our SDKs without too much extra boilerplate.
Fixes SDK-909
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/clerk-expo@clerk/fastifygatsby-plugin-clerk@clerk/localizations@clerk/nextjs@clerk/clerk-react@clerk/remix@clerk/clerk-sdk-node@clerk/shared@clerk/themes@clerk/typesbuild/tooling/chore