Skip to content

Commit d43e215

Browse files
authored
feat(js): Add SDK Options page (#12502)
1 parent ce3059b commit d43e215

File tree

17 files changed

+537
-264
lines changed

17 files changed

+537
-264
lines changed

docs/platforms/javascript/common/configuration/environments.mdx

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/platforms/javascript/common/configuration/integrations/debug.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: "Allows you to inspect the contents of a processed event and hint o
88
<Alert title="Deprecation Notice">
99

1010
The `Debug` Integration is deprecated and will be removed in the next major version of the SDK.
11-
To log outgoing events, we recommend using <PlatformLink to="/configuration/options/#hooks">Hook Options</PlatformLink> in `Sentry.init()`.
11+
To log outgoing events, we recommend using <PlatformLink to="/configuration/options/#beforeSend">beforeSend</PlatformLink> in `Sentry.init()`.
1212

1313
</Alert>
1414

docs/platforms/javascript/common/configuration/options.mdx

Lines changed: 250 additions & 237 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
Options are passed to the `init()` function as object:
2-
1+
Options are passed to the `init()` function as an object:
32

43
```javascript
54
Sentry.init({
65
dsn: "___PUBLIC_DSN___",
7-
maxBreadcrumbs: 50,
86
debug: true,
97
});
108
```

public/_platforms/javascript/nextjs-performance-onboarding-2-configure.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"name": "Next",
66
"aliases": [],
77
"categories": [],
8-
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure, set <code>tracesSampleRate</code> in your config files, <code>sentry.server.config.js</code>, <code>sentry.client.config.js</code>, and <code>sentry.edge.config.js</code>:</p>\n<p>Once this is done, Sentry's Next.js SDK captures all unhandled exceptions and transactions.</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token keyword\">import</span> <span class=\"token operator\">*</span> <span class=\"token keyword\">as</span> Sentry <span class=\"token keyword\">from</span> <span class=\"token string\">\"@sentry/nextjs\"</span><span class=\"token punctuation\">;</span>\n\nSentry<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token comment\">// We recommend adjusting this value in production</span>\n <span class=\"token literal-property property\">tracesSampleRate</span><span class=\"token operator\">:</span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/sampling/#setting-a-sampling-function\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/sampling/#sampling-transaction-events\">sample transactions</a>.</p>"
8+
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>To configure, set <code>tracesSampleRate</code> in your config files, <code>sentry.server.config.js</code>, <code>sentry.client.config.js</code>, and <code>sentry.edge.config.js</code>:</p>\n<p>Once this is done, Sentry's Next.js SDK captures all unhandled exceptions and transactions.</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token keyword\">import</span> <span class=\"token operator\">*</span> <span class=\"token keyword\">as</span> Sentry <span class=\"token keyword\">from</span> <span class=\"token string\">\"@sentry/nextjs\"</span><span class=\"token punctuation\">;</span>\n\nSentry<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token comment\">// We recommend adjusting this value in production</span>\n <span class=\"token literal-property property\">tracesSampleRate</span><span class=\"token operator\">:</span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/sampling/#setting-a-sampling-function\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/sampling/#sampling-transaction-events\">sample transactions</a>.</p>"
99
}

public/_platforms/javascript/performance-onboarding-2-configure.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"name": "JavaScript",
66
"aliases": [],
77
"categories": [],
8-
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>Configuration should happen as early as possible in your application's lifecycle.</p>\n<p>Once this is done, Sentry's JavaScript SDK captures all unhandled exceptions and transactions.</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token keyword\">import</span> <span class=\"token operator\">*</span> <span class=\"token keyword\">as</span> Sentry <span class=\"token keyword\">from</span> <span class=\"token string\">\"@sentry/browser\"</span><span class=\"token punctuation\">;</span>\n\nSentry<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">integrations</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[<span class=\"token class-name\">Sentry<span class=\"token punctuation\">.</span>browserTracingIntegration</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token comment\">// We recommend adjusting this value in production</span>\n <span class=\"token literal-property property\">tracesSampleRate</span><span class=\"token operator\">:</span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n <span class=\"token comment\">// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled</span>\n <span class=\"token literal-property property\">tracePropagationTargets</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"localhost\"</span><span class=\"token punctuation\">,</span> <span class=\"token regex\"><span class=\"token regex-delimiter\">/</span><span class=\"token regex-source language-regex\">^https:\\/\\/yourserver\\.io\\/api</span><span class=\"token regex-delimiter\">/</span></span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/javascript/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/javascript/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/javascript/configuration/sampling/\">sample transactions</a>.</p>"
8+
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>Configuration should happen as early as possible in your application's lifecycle.</p>\n<p>Once this is done, Sentry's JavaScript SDK captures all unhandled exceptions and transactions.</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript highlight\"><code class=\"language-javascript\"><span class=\"token keyword\">import</span> <span class=\"token operator\">*</span> <span class=\"token keyword\">as</span> Sentry <span class=\"token keyword\">from</span> <span class=\"token string\">\"@sentry/browser\"</span><span class=\"token punctuation\">;</span>\n\nSentry<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">integrations</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[<span class=\"token class-name\">Sentry<span class=\"token punctuation\">.</span>browserTracingIntegration</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n\n <span class=\"token comment\">// Set tracesSampleRate to 1.0 to capture 100%</span>\n <span class=\"token comment\">// of transactions for performance monitoring.</span>\n <span class=\"token comment\">// We recommend adjusting this value in production</span>\n <span class=\"token literal-property property\">tracesSampleRate</span><span class=\"token operator\">:</span> <span class=\"token number\">1.0</span><span class=\"token punctuation\">,</span>\n <span class=\"token comment\">// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled</span>\n <span class=\"token literal-property property\">tracePropagationTargets</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"localhost\"</span><span class=\"token punctuation\">,</span> <span class=\"token regex\"><span class=\"token regex-delimiter\">/</span><span class=\"token regex-source language-regex\">^https:\\/\\/yourserver\\.io\\/api</span><span class=\"token regex-delimiter\">/</span></span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>We recommend adjusting the value of <code>tracesSampleRate</code> in production. Learn more about tracing <a href=\"https://docs.sentry.io/platforms/javascript/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/javascript/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/javascript/configuration/sampling/\">sample transactions</a>.</p>"
99
}

0 commit comments

Comments
 (0)