Skip to content

docs: Fix SPM imports in README snippets - #9635

Merged
philprime merged 2 commits into
mainfrom
docs/readme-spm-import
Nov 16, 2026
Merged

philprime merged 2 commits into
mainfrom
docs/readme-spm-import

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Fixes both "Initialization" snippets in the README so they work with the SPM products the README recommends:

  • Swift: import SentrySwift instead of import Sentry, with a comment that the pre-built XCFrameworks still use import Sentry.
  • Objective-C: follows the changelog's SentryObjC migration steps. It points to the SentryObjC product (or SentryObjC-Static / SentryObjC-Dynamic), uses #import <SentryObjC/SentryObjC.h> and SentryObjCSDK / SentryObjCOptions, and sets options.debug = YES (it's a BOOL, not @YES).

💡 Motivation and Context

The README tells you to depend on SentrySPM, but both snippets used import Sentry / @import Sentry;. On 9.x, SentrySPM builds the Swift module as SentrySwift (sentrySwiftTargetName in Package.swift), so following the README exactly fails with no such module 'Sentry'. For Objective-C, the changelog recommends SentryObjC over Sentry / SentrySPM.

Heads up for v10: with SDK_V10=1, Package.swift drops the binary Sentry target and names the source-built product and its Swift module Sentry. When v10 ships, the README's SentrySPM dependency and the import SentrySwift snippet need to go back to Sentry / import Sentry.

Docs counterpart: getsentry/sentry-docs#20822.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

#skip-changelog

via @lcian.

--

View Session [Sentry]

The SentrySPM product builds the SentrySwift module, so
import Sentry fails for anyone following the README.

Co-Authored-By: Lorenzo Cian <[email protected]>
The changelog recommends the SentryObjC product for Objective-C, so
the snippet now imports SentryObjC and uses SentryObjC-prefixed types.

Co-Authored-By: Lorenzo Cian <[email protected]>
@sentry-junior sentry-junior Bot changed the title docs: Fix SentrySPM import in README docs: Fix SPM imports in README snippets Nov 16, 2026
@lcian
lcian marked this pull request as ready for review November 16, 2026 11:15
@lcian
lcian requested review from a team, donnywals and noahsmartin as code owners November 16, 2026 11:15
@lcian
lcian requested review from NinjaLikesCheez and itaybre and removed request for a team November 16, 2026 11:15
@sentry-junior
sentry-junior Bot requested a review from lcian November 16, 2026 11:15
@philprime
philprime enabled auto-merge (squash) November 16, 2026 11:59

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philprime
philprime merged commit 60003f7 into main Nov 16, 2026
365 checks passed
@philprime
philprime deleted the docs/readme-spm-import branch November 16, 2026 12:00
lcian added a commit to getsentry/sentry-docs that referenced this pull request Nov 18, 2026
## DESCRIBE YOUR PR

#20004 made `SentrySPM` the recommended SPM product
in the Apple quick starts but kept the line "Both use `import Sentry`".
That's wrong: on SDK 9.x, `SentrySPM` builds the Swift module as
`SentrySwift` (`sentrySwiftTargetName` in sentry-cocoa's
`Package.swift`). The repo's own integrations use `import SentrySwift`
when built from source. Anyone who follows the quick start as written
gets `no such module 'Sentry'`.

This PR:
- Fixes the shared Apple quick start include (iOS, macOS, tvOS, watchOS,
visionOS) and the iOS manual setup page. They now say `SentrySPM` →
`import SentrySwift` and `Sentry` → `import Sentry`, and that the page's
snippets use `import Sentry`.
- Says on the Swift Package Manager install page which module
`SentrySPM` provides, and that the prebuilt `Sentry`/`Sentry-Dynamic`
products provide `Sentry`.

The code snippets everywhere else still use `import Sentry`. That's
correct for the prebuilt products, and the quick start text now tells
`SentrySPM` users to swap it.

**Heads up for v10:** this only holds for 9.x. In sentry-cocoa's
`Package.swift`, the V10 build (`SDK_V10=1`) drops the binary `Sentry`
target and names the source-built product and its Swift module `Sentry`
instead of `SentrySPM` / `SentrySwift`. When v10 ships, these pages need
updating again: the recommended product becomes `Sentry` and `import
Sentry` works for it.

Companion README fix: getsentry/sentry-cocoa#9635.

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## PRE-MERGE CHECKLIST

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

<!-- junior-request-attribution:start -->
via @lcian.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0B8GLVN8LT%3A1794826946.622569 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0B8GLVN8LT%3A1794826946.622569)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0B8GLVN8LT%3A1794826946.622569/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Lorenzo Cian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants