Skip to main content
If you’re looking for information on how to integrate the SDK, check out our Universal Checkout integration guide.
CocoaPods Trunk stops accepting new versions on 2 December 2026. We recommend Swift Package Manager. If your app uses CocoaPods, follow Migrate from CocoaPods to Swift Package Manager.

With Swift Package Manager

Swift Package Manager is built into Xcode. To add PrimerSDK with Swift Package Manager:
  1. Select your project, and then navigate to Package Dependencies
  2. Click on the + button at the bottom-left of the Packages section
  3. Paste https://github.com/primer-io/primer-sdk-ios into the Search Bar
  4. Press Add Package
  5. Let Xcode download the package and set everything up
From PrimerSDK 2.28.0, the package includes 3D Secure (Primer3DS). You don’t add it separately.

Payment method libraries

Klarna, NOL Pay, ACH via Stripe and iPay88 need a separate Primer library. Swift Package Manager cannot make a library optional. So PrimerSDK has a separate version for each library, and that version adds the library for you. To add a library, set the dependency rule to Exact Version. Enter your PrimerSDK version followed by the suffix for the library: For example, for Klarna with PrimerSDK 2.53.1, enter 2.53.1-3ds-klarna. The -3ds-nolpay, -3ds-stripe and -3ds-ipay88 versions exist from PrimerSDK 2.54.0.
  • Don’t add the library as a separate package. The version with the suffix already includes it, and adding both is unreliable.
  • Always use Exact Version. With Up to Next Major Version, Swift Package Manager picks the version without the library.
  • When you update PrimerSDK, change the version by hand. Keep the same suffix.
  • Each version includes one library. No version includes two.

With CocoaPods (deprecated)

CocoaPods is deprecated for native iOS apps. You can use it with the Primer spec repo for a limited time. To move to Swift Package Manager, follow Migrate from CocoaPods to Swift Package Manager.
Add the following to your Podfile file:
RUBY
Keep both source lines at the top of your Podfile, in this order. CocoaPods Trunk accepts no new versions from 2 December 2026, so Primer publishes new versions to its own spec repo. CocoaPods takes a pod from the first source that has it, so the Primer line comes first. Once a Podfile has a source line, CocoaPods no longer adds its CDN by itself. The CDN line keeps your other pods installing. Older Primer versions are in both sources, so pod install can print Found multiple specifications for Primer pods. This is expected. CocoaPods uses the Primer spec repo, because it comes first.
Then run pod install to install PrimerSDK on your workspace.
In case you encounter an error that the bundle needs signing on Xcode 14, add the following post-install script in your podfile.
RUBY
For more details about SDK versions, please see our changelog.