Skip to content

feat(elements): Add telemetry#3279

Merged
brkalow merged 16 commits intomainfrom
lekoarts/sdk-1658-add-telemetry-to-understand-usage
Apr 30, 2024
Merged

feat(elements): Add telemetry#3279
brkalow merged 16 commits intomainfrom
lekoarts/sdk-1658-add-telemetry-to-understand-usage

Conversation

@LekoArts
Copy link
Copy Markdown
Contributor

@LekoArts LekoArts commented Apr 29, 2024

Description

Adds telemetry tracking to better understand what people build with Elements. Initially we'll be able to see:

  • If a user creates a sign-in and/or sign-up flow
  • Which steps they create
  • Which inputs they use inside their steps

Fixes SDK-1658

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2024

🦋 Changeset detected

Latest commit: 7ef7bea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@clerk/shared Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/clerk-expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts LekoArts added this to the @clerk/elements (Beta) milestone Apr 29, 2024
@LekoArts LekoArts marked this pull request as ready for review April 29, 2024 09:26
Comment on lines +534 to +536

telemetry?.record(eventComponentMounted('Elements_Input', props));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Wouldn't this fire on every re-render ?
  2. Seeing the implementation of eventComponentMounted the props you seem to be interested will be ignored.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes. feat(shared): Introduce client-side caching for telemetry events #3267 is fixing this
  2. Thanks! I fixed it by introducing a new helper function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LekoArts Shall we postpone merging this until #3267 is merged ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They will probably be released around the same time so it's not blocking

* @example
* telemetry.record(eventComponentMounted('SignUp', props));
*/
export function eventComponentMounted(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change this one to eventPrebuiltComponentMounted (or something similar) and expose your currently named eventComponentMountedRaw as eventComponentMounted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

Copy link
Copy Markdown
Member

@brkalow brkalow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brkalow brkalow enabled auto-merge (squash) April 30, 2024 15:29
@brkalow brkalow merged commit 19cd424 into main Apr 30, 2024
@brkalow brkalow deleted the lekoarts/sdk-1658-add-telemetry-to-understand-usage branch April 30, 2024 15:38
@clerk-cookie clerk-cookie mentioned this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants