Overview
The Encore SDK is distributed as a private Swift Package. You’ll receive a GitHub Personal Access Token from the Encore team to authenticate and install the package.Prerequisites: Obtain Access Credentials
You should have received the following from the Encore team:- Repository URL:
https://github.com/EncoreKit/ios-sdk - Access Token: A GitHub Personal Access Token (starts with
ghp_...)
Don’t have credentials? Contact us in your dedicated support channel.
Install via Swift Package Manager
Swift Package Manager is Apple’s official dependency manager integrated into Xcode.Step 1: Add Package in Xcode
- In Xcode, select File ▸ Add Packages Dependencies…
- Paste the private repository URL:
- Press Return or click the search icon
- When prompted for credentials, enter:
- Username:
encore-sdk(or any text - doesn’t matter) - Password: Paste the access token provided by Encore
- Check “Remember my choice” to avoid re-entering
- Username:
Step 2: Configure Dependency
With the encore-swift-sdk package selected:- Set Dependency Rule to Up to Next Major Version
- Set the lower bound to 1.0.0
- Make sure your project is selected in Add to Project
- Click Add Package
Step 3: Add to Target
After the package resolves:- Ensure Add to Target is set to your app’s name
- Click Add Package
Step 4: Verify Installation
You should now be able to import the SDK:Next Steps
Now that the SDK is installed, you’re ready to:- Configure the SDK - Set up your API key and initialize Encore
- Identify Users - Learn how to identify users for offer tracking
- Present Offers - Start showing offers in your app
Advanced Topics
CI/CD Configuration
CI/CD Configuration
If you’re using continuous integration, you’ll need to configure authentication in your CI environment.GitHub ActionsAdd the Encore-provided access token as a repository secret:Xcode CloudBitrise / CircleCI / Other CIAdd the token as an environment variable and configure Git:
- Go to your repository Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
ENCORE_GITHUB_TOKEN - Value: The access token provided by Encore
- Add to your workflow YAML:
- Go to App Store Connect → Your App → Xcode Cloud
- Navigate to Settings → Environment
- Add a new secret environment variable:
- Name:
ENCORE_GITHUB_TOKEN - Value: The access token provided by Encore
- Name:
- Create a custom build script in Xcode:
- Right-click on your project in Xcode
- Click New Group
- Name the group
ci_scripts - Right-click the
ci_scriptsgroup - Click New Empty File
- Name the file
ci_post_clone.sh - Paste the following content in that file:
ci_post_clone.sh
Updating to a New Release
Updating to a New Release
To update to the latest version:
- In Xcode, select your project in the navigator
- Select the Package Dependencies tab
- Find encore-swift-sdk in the list
- Click the refresh button or right-click and select Update Package
- Right-click encore-swift-sdk in Package Dependencies
- Select Update to Latest Package Versions or specify an exact version