Skip to content

Commit e19c3ef

Browse files
authored
feat(browser): Export sendFeedback from CDN bundles (#17495)
This adds the `sendFeedback` method to the CDN bundle exports. This should not really add bundle size as this is used by the feedback integration anyhow I believe. (Some unrelated prettier fixes somehow also got into this PR, not sure how this got on develop)
1 parent abdc3b5 commit e19c3ef

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

dev-packages/node-integration-tests/suites/tracing/anthropic/instrument-with-pii.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@ Sentry.init({
88
tracesSampleRate: 1.0,
99
sendDefaultPii: true,
1010
transport: loggingTransport,
11-
integrations: [
12-
Sentry.anthropicAIIntegration(),
13-
nodeContextIntegration(),
14-
],
11+
integrations: [Sentry.anthropicAIIntegration(), nodeContextIntegration()],
1512
});

dev-packages/node-integration-tests/suites/tracing/anthropic/instrument.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ Sentry.init({
99
sendDefaultPii: false,
1010
transport: loggingTransport,
1111
// Force include the integration
12-
integrations: [
13-
Sentry.anthropicAIIntegration(),
14-
nodeContextIntegration(),
15-
],
12+
integrations: [Sentry.anthropicAIIntegration(), nodeContextIntegration()],
1613
});

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario-stream.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,3 @@ async function run() {
101101
}
102102

103103
run();
104-
105-

dev-packages/node-integration-tests/suites/tracing/anthropic/scenario.mjs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class MockAnthropic {
88
// Create messages object with create and countTokens methods
99
this.messages = {
1010
create: this._messagesCreate.bind(this),
11-
countTokens: this._messagesCountTokens.bind(this)
11+
countTokens: this._messagesCountTokens.bind(this),
1212
};
1313

1414
this.models = {
@@ -56,8 +56,8 @@ class MockAnthropic {
5656

5757
// For countTokens, just return input_tokens
5858
return {
59-
input_tokens: 15
60-
}
59+
input_tokens: 15,
60+
};
6161
}
6262

6363
async _modelsRetrieve(modelId) {
@@ -69,7 +69,7 @@ class MockAnthropic {
6969
id: modelId,
7070
name: modelId,
7171
created_at: 1715145600,
72-
model: modelId, // Add model field to match the check in addResponseAttributes
72+
model: modelId, // Add model field to match the check in addResponseAttributes
7373
};
7474
}
7575
}
@@ -86,9 +86,7 @@ async function run() {
8686
await client.messages.create({
8787
model: 'claude-3-haiku-20240307',
8888
system: 'You are a helpful assistant.',
89-
messages: [
90-
{ role: 'user', content: 'What is the capital of France?' },
91-
],
89+
messages: [{ role: 'user', content: 'What is the capital of France?' }],
9290
temperature: 0.7,
9391
max_tokens: 100,
9492
});
@@ -106,9 +104,7 @@ async function run() {
106104
// Third test: count tokens with cached tokens
107105
await client.messages.countTokens({
108106
model: 'claude-3-haiku-20240307',
109-
messages: [
110-
{ role: 'user', content: 'What is the capital of France?' },
111-
],
107+
messages: [{ role: 'user', content: 'What is the capital of France?' }],
112108
});
113109

114110
// Fourth test: models.retrieve

packages/browser/src/index.bundle.feedback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { feedbackAsyncIntegration } from './feedbackAsync';
33

44
export * from './index.bundle.base';
55

6-
export { getFeedback } from '@sentry-internal/feedback';
6+
export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
77

88
export {
99
browserTracingIntegrationShim as browserTracingIntegration,

packages/browser/src/index.bundle.tracing.replay.feedback.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export {
2222
startBrowserTracingNavigationSpan,
2323
startBrowserTracingPageLoadSpan,
2424
} from './tracing/browserTracingIntegration';
25-
export { getFeedback } from '@sentry-internal/feedback';
25+
26+
export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
27+
2628
export { feedbackAsyncIntegration as feedbackAsyncIntegration, feedbackAsyncIntegration as feedbackIntegration };
2729

2830
export { replayIntegration, getReplay } from '@sentry-internal/replay';

0 commit comments

Comments
 (0)