@raindrop-ai/wizard 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/docs/claude-agent-sdk.mdx +382 -0
- package/dist/src/docs/{python.md → python.mdx} +14 -2
- package/dist/src/docs/{typescript.md → typescript.mdx} +8 -4
- package/dist/src/docs/vercel-ai-sdk.mdx +769 -0
- package/dist/src/lib/agent-interface.d.ts +4 -3
- package/dist/src/lib/agent-interface.js +290 -197
- package/dist/src/lib/agent-interface.js.map +1 -1
- package/dist/src/lib/constants.d.ts +1 -0
- package/dist/src/lib/constants.js +1 -0
- package/dist/src/lib/constants.js.map +1 -1
- package/dist/src/lib/handlers.d.ts +16 -8
- package/dist/src/lib/handlers.js +232 -118
- package/dist/src/lib/handlers.js.map +1 -1
- package/dist/src/lib/integration-testing.d.ts +5 -5
- package/dist/src/lib/integration-testing.js +28 -12
- package/dist/src/lib/integration-testing.js.map +1 -1
- package/dist/src/lib/mcp.d.ts +1 -1
- package/dist/src/lib/mcp.js +88 -49
- package/dist/src/lib/mcp.js.map +1 -1
- package/dist/src/lib/sdk-messages.d.ts +8 -1
- package/dist/src/lib/sdk-messages.js +83 -27
- package/dist/src/lib/sdk-messages.js.map +1 -1
- package/dist/src/lib/wizard.js +16 -20
- package/dist/src/lib/wizard.js.map +1 -1
- package/dist/src/ui/App.d.ts +5 -4
- package/dist/src/ui/App.js +12 -12
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/components/ClarifyingQuestionsPrompt.js +4 -2
- package/dist/src/ui/components/ClarifyingQuestionsPrompt.js.map +1 -1
- package/dist/src/ui/components/ContinuePrompt.d.ts +3 -2
- package/dist/src/ui/components/ContinuePrompt.js +4 -4
- package/dist/src/ui/components/ContinuePrompt.js.map +1 -1
- package/dist/src/ui/components/DiffDisplay.js +16 -6
- package/dist/src/ui/components/DiffDisplay.js.map +1 -1
- package/dist/src/ui/components/FeedbackSelectPrompt.js +6 -3
- package/dist/src/ui/components/FeedbackSelectPrompt.js.map +1 -1
- package/dist/src/ui/components/HistoryItemDisplay.d.ts +5 -3
- package/dist/src/ui/components/HistoryItemDisplay.js +10 -9
- package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -1
- package/dist/src/ui/components/Logo.js +19 -34
- package/dist/src/ui/components/Logo.js.map +1 -1
- package/dist/src/ui/components/OrgInfoBox.d.ts +2 -1
- package/dist/src/ui/components/OrgInfoBox.js +2 -4
- package/dist/src/ui/components/OrgInfoBox.js.map +1 -1
- package/dist/src/ui/components/PersistentTextInput.js +13 -11
- package/dist/src/ui/components/PersistentTextInput.js.map +1 -1
- package/dist/src/ui/components/PromptContainer.js +4 -8
- package/dist/src/ui/components/PromptContainer.js.map +1 -1
- package/dist/src/ui/components/ToolApprovalPrompt.js +4 -4
- package/dist/src/ui/components/ToolApprovalPrompt.js.map +1 -1
- package/dist/src/ui/components/WriteKeyDisplay.d.ts +1 -1
- package/dist/src/ui/components/WriteKeyDisplay.js +1 -1
- package/dist/src/ui/components/WriteKeyDisplay.js.map +1 -1
- package/dist/src/ui/contexts/WizardContext.d.ts +13 -5
- package/dist/src/ui/contexts/WizardContext.js +60 -20
- package/dist/src/ui/contexts/WizardContext.js.map +1 -1
- package/dist/src/ui/render.js +49 -5
- package/dist/src/ui/render.js.map +1 -1
- package/dist/src/ui/types.d.ts +4 -2
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/utils/oauth.js +0 -4
- package/dist/src/utils/oauth.js.map +1 -1
- package/dist/src/utils/session.d.ts +1 -0
- package/dist/src/utils/session.js +40 -1
- package/dist/src/utils/session.js.map +1 -1
- package/dist/src/utils/ui.d.ts +7 -2
- package/dist/src/utils/ui.js +9 -2
- package/dist/src/utils/ui.js.map +1 -1
- package/package.json +2 -1
- package/dist/src/docs/vercel-ai-sdk.md +0 -304
- /package/dist/src/docs/{browser.md → browser.mdx} +0 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Claude Agent SDK
|
|
3
|
+
description: >-
|
|
4
|
+
Reference for integrating Raindrop with the Claude Agent SDK.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `@raindrop-ai/claude-agent-sdk` package wraps the
|
|
8
|
+
[Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview) so
|
|
9
|
+
you can capture events and traces from `query()` calls. Pass `eventMetadata()`
|
|
10
|
+
to the queries you want tracked in Raindrop.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
<CodeGroup>
|
|
15
|
+
```bash npm
|
|
16
|
+
npm install @raindrop-ai/claude-agent-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash yarn
|
|
20
|
+
yarn add @raindrop-ai/claude-agent-sdk
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash pnpm
|
|
24
|
+
pnpm add @raindrop-ai/claude-agent-sdk
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash bun
|
|
28
|
+
bun add @raindrop-ai/claude-agent-sdk
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</CodeGroup>
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import * as claudeAgentSDK from '@anthropic-ai/claude-agent-sdk';
|
|
37
|
+
import {
|
|
38
|
+
createRaindropClaudeAgentSDK,
|
|
39
|
+
eventMetadata,
|
|
40
|
+
} from '@raindrop-ai/claude-agent-sdk';
|
|
41
|
+
|
|
42
|
+
// 1. Create the Raindrop client
|
|
43
|
+
const raindrop = createRaindropClaudeAgentSDK({
|
|
44
|
+
writeKey: process.env.RAINDROP_WRITE_KEY!,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// 2. Wrap the Claude Agent SDK
|
|
48
|
+
const { query, createSdkMcpServer, ReadTool, EditTool } = raindrop.wrap(
|
|
49
|
+
claudeAgentSDK,
|
|
50
|
+
{
|
|
51
|
+
context: {
|
|
52
|
+
properties: {
|
|
53
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// 3. Add eventMetadata() on queries you want tracked
|
|
60
|
+
for await (const message of query(
|
|
61
|
+
{
|
|
62
|
+
prompt: 'List files in the current directory',
|
|
63
|
+
options: {
|
|
64
|
+
allowedTools: ['Bash'],
|
|
65
|
+
model: 'claude-sonnet-4.5',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
eventMetadata({
|
|
69
|
+
userId, // REQUIRED: authenticated user id from your app
|
|
70
|
+
eventName, // Optional: e.g. 'agent_query'
|
|
71
|
+
}),
|
|
72
|
+
)) {
|
|
73
|
+
console.log(message);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Optional: identify user traits
|
|
77
|
+
await raindrop.users.identify({
|
|
78
|
+
userId,
|
|
79
|
+
traits: {
|
|
80
|
+
plan: userPlan,
|
|
81
|
+
email: userEmail,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// 4. Flush before shutdown (serverless/scripts)
|
|
86
|
+
await raindrop.flush();
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Queries with `eventMetadata()` are tracked with events and traces. Queries
|
|
90
|
+
without it run normally and are not tracked.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
### Client Options
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
const raindrop = createRaindropClaudeAgentSDK({
|
|
100
|
+
writeKey: process.env.RAINDROP_WRITE_KEY!, // REQUIRED
|
|
101
|
+
endpoint: 'https://api.raindrop.ai/v1', // Optional, defaults to production
|
|
102
|
+
|
|
103
|
+
traces: {
|
|
104
|
+
enabled: true, // Default: true
|
|
105
|
+
flushIntervalMs: 5000, // Default: 5000
|
|
106
|
+
maxBatchSize: 100, // Default: 100
|
|
107
|
+
maxQueueSize: 1000, // Default: 1000
|
|
108
|
+
debug: false, // Logs trace shipping
|
|
109
|
+
debugSpans: false, // Logs span parent relationships
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
events: {
|
|
113
|
+
enabled: true, // Default: true
|
|
114
|
+
partialFlushMs: 1000, // Debounce for streaming updates
|
|
115
|
+
debug: false, // Logs event shipping
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Wrap Options
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
const wrapped = raindrop.wrap(claudeAgentSDK, {
|
|
124
|
+
context: {
|
|
125
|
+
properties: {
|
|
126
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Per-Query Context
|
|
133
|
+
|
|
134
|
+
Use `eventMetadata()` as the second argument when you want a query tracked.
|
|
135
|
+
`userId` is required:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { eventMetadata } from '@raindrop-ai/claude-agent-sdk';
|
|
139
|
+
|
|
140
|
+
const wrapped = raindrop.wrap(claudeAgentSDK, {
|
|
141
|
+
context: {
|
|
142
|
+
properties: {
|
|
143
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
for await (const msg of wrapped.query(
|
|
149
|
+
{ prompt: userPrompt, options: { model: modelName } },
|
|
150
|
+
eventMetadata({
|
|
151
|
+
userId, // REQUIRED
|
|
152
|
+
convoId, // Optional: conversation/thread id from your app
|
|
153
|
+
eventName, // Optional
|
|
154
|
+
properties: { tier: userTier },
|
|
155
|
+
}),
|
|
156
|
+
)) {
|
|
157
|
+
console.log(msg);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
You can also set `convoId`, `eventName`, `properties`, or `eventId` per query.
|
|
162
|
+
|
|
163
|
+
**Defaults:**
|
|
164
|
+
|
|
165
|
+
- If `eventMetadata()` is omitted, the query runs normally but no events or
|
|
166
|
+
traces are captured by Raindrop
|
|
167
|
+
- `eventName` defaults to `"agent_query"`
|
|
168
|
+
- `convoId` is auto-captured from Claude's `session_id` if not provided
|
|
169
|
+
- `eventId` is auto-generated if not provided
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Identifying Users
|
|
174
|
+
|
|
175
|
+
Use `users.identify` to associate traits with a user:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
await raindrop.users.identify({
|
|
179
|
+
userId,
|
|
180
|
+
traits: {
|
|
181
|
+
email: userEmail,
|
|
182
|
+
plan: userPlan,
|
|
183
|
+
orgId,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Signals (Feedback)
|
|
191
|
+
|
|
192
|
+
Track user feedback on AI responses using the same `eventId`:
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { eventMetadata } from '@raindrop-ai/claude-agent-sdk';
|
|
196
|
+
|
|
197
|
+
const eventId = crypto.randomUUID();
|
|
198
|
+
const wrapped = raindrop.wrap(claudeAgentSDK, {
|
|
199
|
+
context: {
|
|
200
|
+
properties: {
|
|
201
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
for await (const msg of wrapped.query(
|
|
207
|
+
{ prompt: userMessage, options: { model: 'claude-sonnet-4.5' } },
|
|
208
|
+
eventMetadata({ userId, eventId }),
|
|
209
|
+
)) {
|
|
210
|
+
console.log(msg);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Later, when user gives feedback
|
|
214
|
+
await raindrop.signals.track({
|
|
215
|
+
eventId,
|
|
216
|
+
name: 'thumbs_down',
|
|
217
|
+
comment: 'Answer was incorrect',
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Signal Types
|
|
222
|
+
|
|
223
|
+
| Type | Use Case |
|
|
224
|
+
| ------------ | -------------------------------- |
|
|
225
|
+
| `"default"` | Generic signals (thumbs up/down) |
|
|
226
|
+
| `"feedback"` | User comments about quality |
|
|
227
|
+
| `"edit"` | User corrected the output |
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
// Thumbs up
|
|
231
|
+
await raindrop.signals.track({
|
|
232
|
+
eventId,
|
|
233
|
+
name: 'thumbs_up',
|
|
234
|
+
sentiment: 'POSITIVE',
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// User edit
|
|
238
|
+
await raindrop.signals.track({
|
|
239
|
+
eventId,
|
|
240
|
+
name: 'user_edit',
|
|
241
|
+
type: 'edit',
|
|
242
|
+
after: 'The corrected response text',
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Manual Event Updates
|
|
249
|
+
|
|
250
|
+
Update events after they're created (use `eventId` from `eventMetadata`):
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
const eventId = crypto.randomUUID();
|
|
254
|
+
const wrapped = raindrop.wrap(claudeAgentSDK, {
|
|
255
|
+
context: {
|
|
256
|
+
properties: {
|
|
257
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
for await (const msg of wrapped.query(
|
|
263
|
+
{ prompt, options },
|
|
264
|
+
eventMetadata({ userId, eventId }),
|
|
265
|
+
)) {
|
|
266
|
+
// ...
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Add properties after the query completes
|
|
270
|
+
await raindrop.events.setProperties(eventId, {
|
|
271
|
+
latencyMs: 1234,
|
|
272
|
+
cached: true,
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// Add attachments
|
|
276
|
+
await raindrop.events.addAttachments(eventId, [
|
|
277
|
+
{
|
|
278
|
+
type: 'code',
|
|
279
|
+
name: 'generated.py',
|
|
280
|
+
value: "print('hello')",
|
|
281
|
+
role: 'output',
|
|
282
|
+
language: 'python',
|
|
283
|
+
},
|
|
284
|
+
]);
|
|
285
|
+
|
|
286
|
+
// Mark as complete (triggers immediate shipping)
|
|
287
|
+
await raindrop.events.finish(eventId);
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
<Info>
|
|
291
|
+
The event is automatically finalized when the query stream completes. Use
|
|
292
|
+
`finish()` only when you need to force immediate shipping before the stream
|
|
293
|
+
ends.
|
|
294
|
+
</Info>
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Flush & Shutdown
|
|
299
|
+
|
|
300
|
+
Always flush before your process exits to ensure all data is sent:
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
import { eventMetadata } from '@raindrop-ai/claude-agent-sdk';
|
|
304
|
+
|
|
305
|
+
// Serverless: flush at end of request
|
|
306
|
+
export async function POST(request: Request) {
|
|
307
|
+
const wrapped = raindrop.wrap(claudeAgentSDK, {
|
|
308
|
+
context: {
|
|
309
|
+
properties: {
|
|
310
|
+
wizardSession: '__WIZARD_SESSION_UUID__', // REQUIRED
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
const messages = [];
|
|
315
|
+
for await (const msg of wrapped.query(
|
|
316
|
+
{ prompt, options },
|
|
317
|
+
eventMetadata({ userId }),
|
|
318
|
+
)) {
|
|
319
|
+
messages.push(msg);
|
|
320
|
+
}
|
|
321
|
+
await raindrop.flush();
|
|
322
|
+
return Response.json({ messages });
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Long-running: shutdown gracefully
|
|
326
|
+
process.on('SIGTERM', async () => {
|
|
327
|
+
await raindrop.shutdown();
|
|
328
|
+
process.exit(0);
|
|
329
|
+
});
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Debugging
|
|
335
|
+
|
|
336
|
+
Enable debug logging to troubleshoot issues:
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
const raindrop = createRaindropClaudeAgentSDK({
|
|
340
|
+
writeKey: process.env.RAINDROP_WRITE_KEY!,
|
|
341
|
+
events: { debug: true },
|
|
342
|
+
traces: { debug: true, debugSpans: true },
|
|
343
|
+
});
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Or via environment variable:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
RAINDROP_AI_DEBUG=1 node your-script.js
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
This logs:
|
|
353
|
+
|
|
354
|
+
- Every event sent to Raindrop
|
|
355
|
+
- Every trace batch shipped
|
|
356
|
+
- Span parent/child relationships (with `debugSpans`)
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Troubleshooting
|
|
361
|
+
|
|
362
|
+
### Events not appearing in dashboard
|
|
363
|
+
|
|
364
|
+
1. **Ensure tracked queries include `eventMetadata()`**
|
|
365
|
+
2. **Check your write key** - Ensure `RAINDROP_WRITE_KEY` is set correctly
|
|
366
|
+
3. **Flush before exit** - Call `await raindrop.flush()` before your process
|
|
367
|
+
ends
|
|
368
|
+
4. **Enable debug logging** - Set `events: { debug: true }` to see what's being
|
|
369
|
+
sent
|
|
370
|
+
|
|
371
|
+
### Traces missing or incomplete
|
|
372
|
+
|
|
373
|
+
1. **Enable trace debugging** - Set `traces: { debug: true, debugSpans: true }`
|
|
374
|
+
2. **Check for errors** - Look for `[raindrop-ai/claude-agent-sdk]` prefixed
|
|
375
|
+
logs
|
|
376
|
+
|
|
377
|
+
### Wrapper not capturing tool calls
|
|
378
|
+
|
|
379
|
+
Ensure the wrapped `query` is the one you call. Tools are traced via SDK hooks;
|
|
380
|
+
if you call the unwrapped SDK directly, no tracing occurs.
|
|
381
|
+
|
|
382
|
+
---
|
|
@@ -4,12 +4,24 @@ description: Python SDK reference for tracking events and AI interactions.
|
|
|
4
4
|
|
|
5
5
|
### **Installation**
|
|
6
6
|
|
|
7
|
-
Install
|
|
7
|
+
Install with your package manager of choice:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<CodeGroup>
|
|
10
|
+
|
|
11
|
+
```sh pip
|
|
10
12
|
pip install raindrop-ai
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
```sh uv
|
|
16
|
+
uv add raindrop-ai
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```sh poetry
|
|
20
|
+
poetry add raindrop-ai
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
</CodeGroup>
|
|
24
|
+
|
|
13
25
|
### **Configuration**
|
|
14
26
|
|
|
15
27
|
Import the SDK and initialize with the write key from environment variables:
|
|
@@ -71,7 +71,8 @@ const interaction = raindrop.begin({
|
|
|
71
71
|
input: userMessage, // The actual user message/prompt
|
|
72
72
|
model: modelName, // The model being called (e.g. 'gpt-4o')
|
|
73
73
|
convoId: conversationId, // Your app's conversation/thread ID (if applicable)
|
|
74
|
-
properties: {
|
|
74
|
+
properties: {
|
|
75
|
+
// Optional: any custom metadata relevant to your app
|
|
75
76
|
system_prompt: systemPrompt,
|
|
76
77
|
},
|
|
77
78
|
});
|
|
@@ -137,7 +138,8 @@ raindrop.trackAi({
|
|
|
137
138
|
model: modelName, // The model being called (e.g. 'gpt-4o-mini')
|
|
138
139
|
input: userPrompt, // The actual prompt sent to the model
|
|
139
140
|
output: modelResponse, // The actual response from the model
|
|
140
|
-
properties: {
|
|
141
|
+
properties: {
|
|
142
|
+
// Optional: any custom metadata relevant to your app
|
|
141
143
|
system_prompt: systemPrompt,
|
|
142
144
|
tool_call: toolName,
|
|
143
145
|
},
|
|
@@ -215,7 +217,8 @@ interaction.addAttachments([
|
|
|
215
217
|
// Pass actual user data from your app's auth/session
|
|
216
218
|
raindrop.setUserDetails({
|
|
217
219
|
userId: userId, // The authenticated user's unique identifier
|
|
218
|
-
traits: {
|
|
220
|
+
traits: {
|
|
221
|
+
// Pass any user traits available in your app — all keys are optional and freeform
|
|
219
222
|
name: userName,
|
|
220
223
|
email: userEmail,
|
|
221
224
|
},
|
|
@@ -453,7 +456,8 @@ If automatic instrumentation fails due to module loading order or bundler
|
|
|
453
456
|
behavior, use `instrumentModules` to explicitly specify modules to instrument:
|
|
454
457
|
|
|
455
458
|
<Warning>
|
|
456
|
-
**Anthropic users:** You must use a module namespace import (`import * as
|
|
459
|
+
**Anthropic users:** You must use a module namespace import (`import * as
|
|
460
|
+
...`), not the default export.
|
|
457
461
|
</Warning>
|
|
458
462
|
|
|
459
463
|
```typescript
|