Skip to content

Commit e5061ed

Browse files
brkalowalexisintechpanteliselefLekoArts
committed
feat: adds telemetry page (#496)
Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Co-authored-by: panteliselef <panteliselef@outlook.com> Co-authored-by: Lennart <lekoarts@gmail.com>
1 parent b5f0ea0 commit e5061ed

File tree

4 files changed

+123
-2
lines changed

4 files changed

+123
-2
lines changed

docs/components/clerk-provider.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ The `<ClerkProvider>` component must be added to your React entrypoint.
108108
| `isSatellite?` | `boolean \| ((url: URL) => boolean)` | This option defines that the application is a satellite application. |
109109
| `domain?` | `string \| ((url: URL) => boolean)` | This option sets the domain of the satellite application. If your application is a satellite application, this option is required. |
110110
| `signInUrl` | `string` | This url will be used for any redirects that might happen and needs to point to your primary application. This option is optional for production instances and required for development instances. |
111+
| `telemetry?` | `false \| { disabled?: boolean; debug?: boolean } \| undefined` | Controls whether or not Clerk will collect [telemetry data](/docs/telemetry). |
112+
111113

112114
[components-ref]: /docs/components/overview
113115
[ap-ref]: /docs/account-portal/overview

docs/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@
420420
],
421421
[
422422
{
423-
"title": "Security",
423+
"title": "Security & Privacy",
424424
"icon": "lock-closed",
425425
"root": "security"
426426
},
@@ -434,6 +434,7 @@
434434
["CSRF protection", "/security/csrf-protection"],
435435
["Fixation protection", "/security/fixation-protection"],
436436
["Password protection and rules", "/security/password-protection"],
437+
["Clerk Telemetry", "/telemetry"],
437438
"# Protect accounts from attacks",
438439
["Brute force attacks and locking user accounts","/security/user-lock-guide"],
439440
["Customize max login attempts and duration of of user lockout", "/security/customize-user-lockout"],

docs/references/javascript/clerk/clerk.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ All props below are optional.
9999
| `allowedRedirectOrigins` | `Array<string \| RegExp> \| undefined` | Optional array of domains used to validate against the query param of an auth redirect.<br />If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning passed to the console. |
100100
| `isInterstitial` | `boolean \| undefined` | Indicates that Clerk.js will be loaded from interstitial. Defaults to `false` |
101101
| `isSatellite` | `boolean \| ((url: URL) => boolean) \| undefined` | Clerk Flag for satellite apps. Experimental. |
102+
| `telemetry?` | `false \| { disabled?: boolean; debug?: boolean } \| undefined` | Controls whether or not Clerk will collect [telemetry data](/docs/telemetry). |
103+
102104

103105
### `signOut()`
104106

@@ -230,4 +232,4 @@ In addition to the methods listed above, the `Clerk` class also has the followin
230232
[user-ref]: /docs/references/javascript/user/user
231233
[organization-ref]: /docs/references/javascript/organization/organization
232234
[components-ref]: /docs/components/overview
233-
[ap-ref]: /docs/account-portal/overview
235+
[ap-ref]: /docs/account-portal/overview

docs/telemetry.mdx

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: Clerk Telemetry
3+
description: Clerk collects telemetry data from its SDKs about general product and feature usage.
4+
---
5+
6+
# Clerk Telemetry
7+
8+
Clerk collects telemetry data from its SDKs about general product and feature usage. Participation in telemetry collection is optional and users of the product can opt-out at any time.
9+
10+
## Why is Clerk collecting telemetry data?
11+
12+
While we actively engage with our users and community to gather feedback and inform our product roadmap, the information collected from these efforts only represents a small subset of our users.
13+
14+
Collecting telemetry data gives us a clearer picture into how our SDKs, components, and authentication helpers are used for a diverse set of problems. This data provides valuable insights to help us prioritize features that are useful and impactful for as many of our users as possible.
15+
16+
## What data is being collected?
17+
18+
We track general usage information about our SDKs, components, and authentication helpers from **development instances only**. While we collect identifiers that allows us to associate events with specific Clerk instances, **we do not collect any information from your users**.
19+
20+
Examples of data we are interested in:
21+
22+
- How often are our different components (`<SignIn />`, `<SignUp />`, `<UserProfile />`) rendered?
23+
- What props are being used?
24+
- How are developers utilizing the `appearance` prop on our components?
25+
- What versions of our SDKs are being used?
26+
- What associated framework versions are being used? (e.g. what `next` version is being used along with `@clerk/nextjs`)
27+
- Usage of new features
28+
29+
<Callout type="info">
30+
We regularly audit this list to ensure it is an accurate representation of the data we are collecting. To audit telemetry data sent from our SDKs yourself, you can set a `CLERK_TELEMETRY_DEBUG=1` environment variable in your application. In this mode, telemetry events are only logged to the console and not sent to Clerk.
31+
</Callout>
32+
33+
An example event looks like this:
34+
35+
```js
36+
{
37+
event: 'COMPONENT_MOUNTED',
38+
cv: '4.62.1',
39+
sdk: '@clerk/nextjs',
40+
sdkv: '4.25.6',
41+
pk: 'pk_test_YmFsYW5jZWQtY293YmlyZC0xNi5jbGVyay5hY2NvdW50cy5kDXyk',
42+
payload: { component: 'SignIn', appearanceProp: false },
43+
}
44+
```
45+
46+
- `event` — A unique identifier for the event type.
47+
- `cv` — Clerk Version. The version of the core Clerk library in use.
48+
- `sdk` — SDK. The Clerk SDK that is being used.
49+
- `sdkv` — SDK Version. The version of the Clerk SDK.
50+
- `pk` — Publishable Key. The instance's publishable key.
51+
- `payload` — Each unique event can provide custom data as part of the payload. As seen above, for the `COMPONENT_MOUNTED` event we track the component name and additional data about prop usage.
52+
53+
## What about sensitive data?
54+
55+
We will not collect sensitive data from your application or development environment that is not directly related to your implementation of Clerk's SDKs. Notably, we will not collect: environment variables unrelated to Clerk, any information about your users, file paths, contents of files, logs, git remote information, or raw JavaScript errors.
56+
57+
## How is my data protected?
58+
59+
Clerk takes data privacy and protection seriously. Telemetry data is most useful in aggregate form to gain product insights, and the raw data is only available to a small subset of Clerk employees.
60+
61+
We will never share with or sell telemetry data to third parties. The data is used strictly to help improve the Clerk product.
62+
63+
## How do I opt-out?
64+
65+
### Environment variables
66+
67+
<Callout type="warning">
68+
Note that the variable name might differ between frameworks. See the [framework specific instructions](#framework-specific-instructions) below.
69+
</Callout>
70+
71+
For meta-framework SDKs, you can opt-out of telemetry collection by setting the environment variable:
72+
73+
```env filename=".env.local"
74+
CLERK_TELEMETRY_DISABLED=1
75+
```
76+
77+
### `telemetry` prop
78+
79+
If you are using `@clerk/clerk-react` directly, or using an SDK that doesn't have environment variable support, you can opt out by passing the `telemetry` prop to `<ClerkProvider />`:
80+
81+
```tsx
82+
<ClerkProvider telemetry={false} />
83+
```
84+
85+
### Framework specific instructions
86+
87+
<CodeBlockTabs options={["Next.js", "React", "Remix", "Gatsby", "JavaScript", "Chrome Extension", "Expo"]}>
88+
```env filename=".env.local"
89+
NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED=1
90+
```
91+
92+
```tsx
93+
<ClerkProvider telemetry={false} />
94+
```
95+
96+
```env filename=".env.local"
97+
CLERK_TELEMETRY_DISABLED=1
98+
```
99+
100+
```env filename=".env.local"
101+
GATSBY_CLERK_TELEMETRY_DISABLED=1
102+
```
103+
104+
```js
105+
const clerk = new Clerk(publishableKey)
106+
c.load({ telemetry: false })
107+
```
108+
109+
```tsx
110+
<ClerkProvider telemetry={false} />
111+
```
112+
113+
```tsx
114+
<ClerkProvider telemetry={false} />
115+
```
116+
</CodeBlockTabs>

0 commit comments

Comments
 (0)