Repository navigation
docs: Fix SPM imports in README snippets - #9635
Merged
Merged
Conversation
The SentrySPM product builds the SentrySwift module, so import Sentry fails for anyone following the README. Co-Authored-By: Lorenzo Cian <[email protected]>
1 of 6 tasks
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]>
lcian
marked this pull request as ready for review
November 16, 2026 11:15
lcian
requested review from
a team,
donnywals and
noahsmartin
as code owners
November 16, 2026 11:15
lcian
requested review from
NinjaLikesCheez and
itaybre
and removed request for
a team
November 16, 2026 11:15
philprime
enabled auto-merge (squash)
November 16, 2026 11:59
1 of 6 tasks
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Fixes both "Initialization" snippets in the README so they work with the SPM products the README recommends:
import SentrySwiftinstead ofimport Sentry, with a comment that the pre-built XCFrameworks still useimport Sentry.SentryObjCproduct (orSentryObjC-Static/SentryObjC-Dynamic), uses#import <SentryObjC/SentryObjC.h>andSentryObjCSDK/SentryObjCOptions, and setsoptions.debug = YES(it's aBOOL, not@YES).💡 Motivation and Context
The README tells you to depend on
SentrySPM, but both snippets usedimport Sentry/@import Sentry;. On 9.x,SentrySPMbuilds the Swift module asSentrySwift(sentrySwiftTargetNameinPackage.swift), so following the README exactly fails withno such module 'Sentry'. For Objective-C, the changelog recommendsSentryObjCoverSentry/SentrySPM.Heads up for v10: with
SDK_V10=1,Package.swiftdrops the binarySentrytarget and names the source-built product and its Swift moduleSentry. When v10 ships, the README'sSentrySPMdependency and theimport SentrySwiftsnippet need to go back toSentry/import Sentry.Docs counterpart: getsentry/sentry-docs#20822.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.#skip-changelog
via @lcian.
--
View Session [Sentry]