-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(nuxt): Add docs for Pinia plugin #11638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,104 @@ | ||||||
--- | ||||||
title: Pinia | ||||||
description: "Learn about enabling Sentry's Pinia plugin in Nuxt." | ||||||
--- | ||||||
|
||||||
To capture Pinia state data, add `trackPinia` to your client-side Sentry configuration: | ||||||
|
||||||
```javascript {3} {filename:sentry.client.config.ts} | ||||||
Sentry.init({ | ||||||
dsn: "___PUBLIC_DSN___", | ||||||
trackPinia: true // `true` will apply default options | ||||||
}); | ||||||
``` | ||||||
|
||||||
## Normalization Depth | ||||||
|
||||||
By default, Sentry SDKs normalize any context to a depth of 3. You may want to increase this for sending Pinia states by passing `normalizeDepth` to the `Sentry.init` call: | ||||||
|
||||||
```javascript {4} {filename:sentry.client.config.ts} | ||||||
Sentry.init({ | ||||||
dsn: "___PUBLIC_DSN___", | ||||||
trackPinia: true, | ||||||
normalizeDepth: 10, // Or however deep you want your state context to be. | ||||||
}); | ||||||
``` | ||||||
|
||||||
## Options | ||||||
|
||||||
When enabling `trackPinia` with `true`, all default options are automatically applied. To configure the Pinia plugin manually, pass an options object to `trackPinia`. | ||||||
|
||||||
<Alert level="warning" title="Note"> | ||||||
|
||||||
While we try our best to filter out Personally Identifiable Information (PII) such as user passwords, we advise against sending sensitive information to Sentry. | ||||||
|
||||||
</Alert> | ||||||
|
||||||
|
||||||
### `attachPiniaState` (Boolean) | ||||||
|
||||||
This is used to attach Pinia state to Sentry events. By default, this is set to `true`. If you don't want to attach Pinia state to events being sent to Sentry, set this to `false`. | ||||||
|
This is used to attach Pinia state to Sentry events. By default, this is set to `true`. If you don't want to attach Pinia state to events being sent to Sentry, set this to `false`. | |
This is used to attach Pinia state to Sentry events. By default, this is set to `true`. If you don't want to attach Pinia state to events being sent to Sentry, set this to `false`: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to add breadcrumbs to Sentry events. By default, this is set to `true`. If you don't want to add breadcrumbs to events being sent to Sentry, set this to `false`. | |
This is used to add breadcrumbs to Sentry events. By default, this is set to `true`. If you don't want to add breadcrumbs to events being sent to Sentry, set this to `false`: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be used to remove sensitive information from Pinia actions. The first parameter passed to the function is the Pinia action name. We send all actions by default, if you don't want an action name sent to Sentry, use `return null`. | |
This can be used to remove sensitive information from Pinia actions. The first parameter passed to the function is the Pinia action name. We send all actions by default, if you don't want an action name sent to Sentry, use `return null`: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to remove sensitive information from Pinia state. The first parameter passed to the function is the Pinia state. We attach all state changes by default. If you don't want to attach state changes to events being sent to Sentry, use `return null`. Note, that if you choose not to send state to Sentry, your errors might not have the latest version attached. | |
This is used to remove sensitive information from a Pinia state. The first parameter passed to the function is the Pinia state. We attach all state changes by default. If you don't want to attach state changes to events being sent to Sentry, use `return null`. Note, that if you choose not to send state to Sentry, your errors might not have the latest version attached: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.