Skip to content

Commit 4e77ae3

Browse files
committed
docs: clarify customerId examples
1 parent 9c8b8d9 commit 4e77ae3

7 files changed

Lines changed: 25 additions & 25 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const outlit = new Outlit({
4545
outlit.user.identify({
4646
email: 'user@example.com',
4747
traits: { name: 'John Doe' },
48-
customerId: 'cust_123', // The stable account/workspace ID you also use on track()
48+
customerId: 'cust_123', // Your app's account/workspace/customer ID
4949
customerTraits: { plan: 'pro' },
5050
})
5151

@@ -57,7 +57,7 @@ outlit.track('button_clicked', {
5757

5858
// Mark billing status on a customer
5959
outlit.customer.trialing({
60-
customerId: 'cust_123',
60+
customerId: 'cust_123', // Your app's account/workspace/customer ID
6161
properties: { plan: 'pro' },
6262
})
6363
```
@@ -74,10 +74,10 @@ init({ publicKey: 'pk_xxx' })
7474
track('page_viewed', { page: '/home' })
7575
user().identify({
7676
email: 'user@example.com',
77-
customerId: 'cust_123',
77+
customerId: 'cust_123', // Your app's account/workspace/customer ID
7878
})
7979
customer().paid({
80-
customerId: 'cust_123',
80+
customerId: 'cust_123', // Your app's account/workspace/customer ID
8181
properties: { plan: 'pro' },
8282
})
8383
```
@@ -119,7 +119,7 @@ const outlit = new Outlit({
119119

120120
// Track server-side events (requires identity)
121121
outlit.track({
122-
customerId: 'cust_123',
122+
customerId: 'cust_123', // Your app's account/workspace/customer ID
123123
eventName: 'api_request',
124124
properties: {
125125
endpoint: '/api/users',
@@ -135,13 +135,13 @@ outlit.track({
135135
outlit.user.identify({
136136
email: 'user@example.com',
137137
traits: { plan: 'pro' },
138-
customerId: 'cust_123',
138+
customerId: 'cust_123', // Your app's account/workspace/customer ID
139139
customerTraits: { plan: 'pro' },
140140
})
141141

142142
// Mark customer billing status
143143
outlit.customer.paid({
144-
customerId: 'cust_123',
144+
customerId: 'cust_123', // Your app's account/workspace/customer ID
145145
properties: { plan: 'pro' },
146146
})
147147

docs/concepts/customer-journey.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,19 @@ For non-Stripe payment processors or custom billing logic:
162162
```typescript
163163
// When a trial starts
164164
outlit.customer.trialing({
165-
customerId: 'cust_123',
165+
customerId: 'cust_123', // Your app's account/workspace/customer ID
166166
properties: { trialEndsAt: '2025-06-15' }
167167
})
168168

169169
// When payment succeeds
170170
outlit.customer.paid({
171-
customerId: 'cust_123',
171+
customerId: 'cust_123', // Your app's account/workspace/customer ID
172172
properties: { plan: 'pro', amount: 99 }
173173
})
174174

175175
// When subscription is cancelled
176176
outlit.customer.churned({
177-
customerId: 'cust_123',
177+
customerId: 'cust_123', // Your app's account/workspace/customer ID
178178
properties: { reason: 'too_expensive' }
179179
})
180180
```

docs/concepts/identity-resolution.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Your system-owned customer, account, or workspace ID. Use this when product usag
151151
outlit.identify({
152152
email: 'jane@acme.com',
153153
userId: 'usr_12345',
154-
customerId: 'cust_123',
154+
customerId: 'cust_123', // Your app's account/workspace/customer ID
155155
customerTraits: { plan: 'enterprise' }
156156
})
157157
```
@@ -160,7 +160,7 @@ Server-side `track()` calls can also use `customerId` without a user identity:
160160

161161
```typescript
162162
outlit.track({
163-
customerId: 'cust_123',
163+
customerId: 'cust_123', // Your app's account/workspace/customer ID
164164
eventName: 'account_synced'
165165
})
166166
```
@@ -280,7 +280,7 @@ When Outlit detects the same person with different identifiers, profiles are mer
280280

281281
// Account/workspace-scoped event
282282
outlit.track({
283-
customerId: 'cust_123',
283+
customerId: 'cust_123', // Your app's account/workspace/customer ID
284284
eventName: 'workspace_synced'
285285
})
286286
```

docs/tracking/browser/npm.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Identify the current visitor. Links their anonymous history to a known profile.
160160
outlit.identify({
161161
email: 'jane@acme.com',
162162
userId: 'usr_12345',
163-
customerId: 'cust_123',
163+
customerId: 'cust_123', // Your app's account/workspace/customer ID
164164
traits: {
165165
name: 'Jane Doe',
166166
role: 'Engineering Manager',
@@ -200,7 +200,7 @@ Set the current user identity. Ideal for SPA applications where you know the use
200200
outlit.setUser({
201201
email: 'jane@acme.com',
202202
userId: 'usr_12345',
203-
customerId: 'cust_123',
203+
customerId: 'cust_123', // Your app's account/workspace/customer ID
204204
traits: {
205205
name: 'Jane Doe',
206206
},

docs/tracking/browser/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ function MyComponent() {
454454

455455
// Customer billing methods (requires account identifier)
456456
customer.paid({
457-
customerId: 'cust_123',
457+
customerId: 'cust_123', // Your app's account/workspace/customer ID
458458
properties: { plan: 'pro' }
459459
})
460460

docs/tracking/browser/vue.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ user.activate({ flow: 'onboarding' })
291291
292292
// Customer billing methods (requires account identifier)
293293
customer.paid({
294-
customerId: 'cust_123',
294+
customerId: 'cust_123', // Your app's account/workspace/customer ID
295295
properties: { plan: 'pro' }
296296
})
297297

docs/tracking/server/nodejs.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const outlit = new Outlit({
4848
// Track an event
4949
outlit.track({
5050
email: 'user@example.com',
51-
customerId: 'cust_123',
51+
customerId: 'cust_123', // Your app's account/workspace/customer ID
5252
eventName: 'subscription_upgraded',
5353
properties: {
5454
fromPlan: 'starter',
@@ -104,7 +104,7 @@ Track a custom event for a user, a customer, or both.
104104
outlit.track({
105105
email: 'jane@acme.com',
106106
userId: 'usr_12345', // optional if email provided
107-
customerId: 'cust_123',
107+
customerId: 'cust_123', // Your app's account/workspace/customer ID
108108
eventName: 'report_exported',
109109
properties: {
110110
reportType: 'sales',
@@ -155,7 +155,7 @@ Update user traits without tracking an event. Customer metadata can be included
155155
outlit.identify({
156156
email: 'jane@acme.com',
157157
userId: 'usr_12345',
158-
customerId: 'cust_123',
158+
customerId: 'cust_123', // Your app's account/workspace/customer ID
159159
customerTraits: {
160160
plan: 'enterprise',
161161
seats: 50
@@ -224,7 +224,7 @@ Mark an account as trialing.
224224

225225
```typescript
226226
outlit.customer.trialing({
227-
customerId: 'cust_123',
227+
customerId: 'cust_123', // Your app's account/workspace/customer ID
228228
properties: { trialEndsAt: '2024-02-15' }
229229
})
230230
```
@@ -235,7 +235,7 @@ Mark an account as paying.
235235

236236
```typescript
237237
outlit.customer.paid({
238-
customerId: 'cust_123',
238+
customerId: 'cust_123', // Your app's account/workspace/customer ID
239239
properties: { plan: 'pro', amount: 99 }
240240
})
241241
```
@@ -246,7 +246,7 @@ Mark an account as churned.
246246

247247
```typescript
248248
outlit.customer.churned({
249-
customerId: 'cust_123',
249+
customerId: 'cust_123', // Your app's account/workspace/customer ID
250250
properties: { reason: 'cancelled_by_user' }
251251
})
252252
```
@@ -520,7 +520,7 @@ const outlit = new Outlit(options)
520520

521521
const trackOptions: ServerTrackOptions = {
522522
email: 'user@test.com',
523-
customerId: 'cust_123',
523+
customerId: 'cust_123', // Your app's account/workspace/customer ID
524524
eventName: 'test',
525525
properties: { key: 'value' }
526526
}
@@ -537,7 +537,7 @@ outlit.user.activate(stageOptions)
537537

538538
// Account billing options
539539
const billingOptions: BillingOptions = {
540-
customerId: 'cust_123',
540+
customerId: 'cust_123', // Your app's account/workspace/customer ID
541541
properties: { plan: 'pro' }
542542
}
543543

0 commit comments

Comments
 (0)