Skip to content

Commit 37f012b

Browse files
nicohrubeccodex
andauthored
fix(remix): Respect custom default integrations (#25258)
The Remix Node SDK overwrites `defaultIntegrations`, so `false`, `[]`, and custom arrays are ignored. Only generate the framework defaults when the option is unset, matching the underlying Node SDK's behavior. Co-authored-by: Codex <codex@openai.com>
1 parent d5c211d commit 37f012b

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎packages/remix/src/server/sdk.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function init(options: RemixOptions): NodeClient | undefined {
3232
return existingClient;
3333
}
3434

35-
options.defaultIntegrations = getRemixDefaultIntegrations(options);
35+
options.defaultIntegrations ??= getRemixDefaultIntegrations(options);
3636

3737
const client = nodeInit(options);
3838

‎packages/remix/test/index.server.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,24 @@ describe('Server init()', () => {
6969
it('returns client from init', () => {
7070
expect(init({})).not.toBeUndefined();
7171
});
72+
73+
it.each([
74+
{ value: 'false', defaultIntegrations: false as const },
75+
{ value: 'an empty array', defaultIntegrations: [] },
76+
])('disables default integrations when set to $value', ({ defaultIntegrations }) => {
77+
const client = init({ defaultIntegrations });
78+
79+
expect(client?.getOptions().integrations.map(integration => integration.name)).toEqual(['SpanStreaming']);
80+
});
81+
82+
it('replaces default integrations with a custom array', () => {
83+
const integration = { name: 'CustomIntegration' };
84+
85+
const client = init({ defaultIntegrations: [integration] });
86+
87+
expect(client?.getOptions().integrations.map(integration => integration.name)).toEqual([
88+
'CustomIntegration',
89+
'SpanStreaming',
90+
]);
91+
});
7292
});

0 commit comments

Comments
 (0)