File tree Expand file tree Collapse file tree 6 files changed +96
-4
lines changed
Expand file tree Collapse file tree 6 files changed +96
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export type {
1919} from '@sentry/core' ;
2020
2121export type { CloudflareOptions } from './client' ;
22+ export type { VercelAiOptions , VercelAiIntegration } from './integrations/tracing/vercelai-types' ;
2223
2324export {
2425 addEventProcessor ,
Original file line number Diff line number Diff line change 1+ import type { Integration } from '@sentry/core' ;
2+
3+ /**
4+ * Options for the Vercel AI integration.
5+ */
6+ export interface VercelAiOptions {
7+ /**
8+ * Enable or disable input recording. Enabled if `sendDefaultPii` is `true`
9+ * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings
10+ */
11+ recordInputs ?: boolean ;
12+ /**
13+ * Enable or disable output recording. Enabled if `sendDefaultPii` is `true`
14+ * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings
15+ */
16+ recordOutputs ?: boolean ;
17+ }
18+
19+ export interface VercelAiIntegration extends Integration {
20+ options : VercelAiOptions ;
21+ }
Original file line number Diff line number Diff line change 1010
1111import type { IntegrationFn } from '@sentry/core' ;
1212import { addVercelAiProcessors , defineIntegration } from '@sentry/core' ;
13+ import type { VercelAiOptions } from './vercelai-types' ;
1314
1415const INTEGRATION_NAME = 'VercelAI' ;
1516
16- const _vercelAIIntegration = ( ( ) => {
17+ const _vercelAIIntegration = ( ( options : VercelAiOptions = { } ) => {
1718 return {
1819 name : INTEGRATION_NAME ,
20+ options,
1921 setup ( client ) {
2022 addVercelAiProcessors ( client ) ;
2123 } ,
@@ -28,7 +30,29 @@ const _vercelAIIntegration = (() => {
2830 *
2931 * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
3032 *
31- * You need to enable collecting spans for a specific call by setting
33+ * @example
34+ * ```javascript
35+ * const Sentry = require('@sentry/cloudflare');
36+ *
37+ * Sentry.init({
38+ * integrations: [Sentry.vercelAIIntegration()],
39+ * });
40+ * ```
41+ *
42+ * You can configure the integration with options to set default recording preferences:
43+ *
44+ * ```javascript
45+ * Sentry.init({
46+ * integrations: [
47+ * Sentry.vercelAIIntegration({
48+ * recordInputs: true,
49+ * recordOutputs: true,
50+ * }),
51+ * ],
52+ * });
53+ * ```
54+ *
55+ * You need to enable collecting spans for a specific call by setting
3256 * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
3357 *
3458 * ```javascript
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export type {
1919} from '@sentry/core' ;
2020
2121export type { VercelEdgeOptions } from './types' ;
22+ export type { VercelAiOptions , VercelAiIntegration } from './integrations/tracing/vercelai-types' ;
2223
2324export {
2425 addEventProcessor ,
Original file line number Diff line number Diff line change 1+ import type { Integration } from '@sentry/core' ;
2+
3+ /**
4+ * Options for the Vercel AI integration.
5+ */
6+ export interface VercelAiOptions {
7+ /**
8+ * Enable or disable input recording. Enabled if `sendDefaultPii` is `true`
9+ * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings
10+ */
11+ recordInputs ?: boolean ;
12+ /**
13+ * Enable or disable output recording. Enabled if `sendDefaultPii` is `true`
14+ * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings
15+ */
16+ recordOutputs ?: boolean ;
17+ }
18+
19+ export interface VercelAiIntegration extends Integration {
20+ options : VercelAiOptions ;
21+ }
Original file line number Diff line number Diff line change 1010
1111import type { IntegrationFn } from '@sentry/core' ;
1212import { addVercelAiProcessors , defineIntegration } from '@sentry/core' ;
13+ import type { VercelAiOptions } from './vercelai-types' ;
1314
1415const INTEGRATION_NAME = 'VercelAI' ;
1516
16- const _vercelAIIntegration = ( ( ) => {
17+ const _vercelAIIntegration = ( ( options : VercelAiOptions = { } ) => {
1718 return {
1819 name : INTEGRATION_NAME ,
20+ options,
1921 setup ( client ) {
2022 addVercelAiProcessors ( client ) ;
2123 } ,
@@ -28,7 +30,29 @@ const _vercelAIIntegration = (() => {
2830 *
2931 * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
3032 *
31- * You need to enable collecting spans for a specific call by setting
33+ * @example
34+ * ```javascript
35+ * const Sentry = require('@sentry/vercel-edge');
36+ *
37+ * Sentry.init({
38+ * integrations: [Sentry.vercelAIIntegration()],
39+ * });
40+ * ```
41+ *
42+ * You can configure the integration with options to set default recording preferences:
43+ *
44+ * ```javascript
45+ * Sentry.init({
46+ * integrations: [
47+ * Sentry.vercelAIIntegration({
48+ * recordInputs: true,
49+ * recordOutputs: true,
50+ * }),
51+ * ],
52+ * });
53+ * ```
54+ *
55+ * You need to enable collecting spans for a specific call by setting
3256 * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
3357 *
3458 * ```javascript
You can’t perform that action at this time.
0 commit comments