8000 docs: raven-js migration user context example (#3824) · tomoat/sentry-javascript@e5e8493 · GitHub
[go: up one dir, main page]

Skip to content

Commit e5e8493

Browse files
authored
docs: raven-js migration user context example (getsentry#3824)
* docs: raven-js migration user context example
1 parent b6e3554 commit e5e8493

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

MIGRATION.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ _New_:
173173
Sentry.setTag('key', 'value');
174174
```
175175

176+
#### Set user context
177+
178+
_Old_:
179+
180+
```js
181+
Raven.setUserContext({
182+
id: '123',
183+
email: 'david@example.com',
184+
});
185+
```
186+
187+
_New_:
188+
189+
```js
190+
Sentry.setUser({
191+
id: '123',
192+
email: 'david@example.com',
193+
});
194+
```
195+
176196
#### Capture custom exception
177197

178198
> A scope must now be sent around a capture to add extra information. [Docs](https://docs.sentry.io/platforms/javascript/#unsetting-context)

0 30B2 commit comments

Comments
 (0)
0