Skip to content

fix: accept any Sentry integration in sentry.integrations (2.4.1) - #22

Merged
benminer merged 2 commits into
mainfrom
benminer/sentry-integration-type
Oct 20, 2026
Merged

benminer merged 2 commits into
mainfrom
benminer/sentry-integration-type

Conversation

@benminer

Copy link
Copy Markdown
Collaborator

Summary

SentryConfig.integrations was typed as ReturnType<typeof Sentry.expressIntegration>[]. Since Sentry 10.7x, each integration's type includes its literal name, so agentic-api's httpIntegration() no longer type-checks:

src/instrument.ts(67,7): error TS2322: Type 'Integration & { name: "Http"; }' is not assignable to type 'Integration & { name: "Express"; }'.

The type is now derived from NodeOptions['integrations'], so any Sentry integration is accepted. Integration is only exported from @sentry/core, which isn't a direct dependency, hence the derived type.

This blocks the agentic-api bump to observability-js 2.4.x.

Test plan

  • New type-level test passes httpIntegration(). With the old type it fails npm run typecheck; with the fix it passes.
  • npm run build && npm run typecheck && npm run lint && npm test (58 passing)
  • CI
  • After merge: run the release workflow; agentic-api moves to 2.4.1

🤖 Generated with Claude Code

benminer and others added 2 commits October 20, 2026 16:36
The integrations type was derived from expressIntegration's return type.
Since Sentry 10.7x each integration's type carries its literal name, so
passing httpIntegration() fails to type-check. Derive the type from
NodeOptions['integrations'] instead.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@benminer
benminer merged commit f6f1d80 into main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant