Purpl Docs
Quick start
Choose one integration path and complete the minimum setup and first request.
SDK only
Configure every product and entitlement in app code without a Purpl account or server. Choose your app platform in the code tabs.
- Add Purpl-Swift in Xcode Package Dependencies, or add Purpl-Android as a Gradle composite build.
- Define every app product and entitlement in PurchaseConfiguration.
- Call Purchases.configure at launch and read access from CustomerInfo.
https://github.com/ineedtoint/Purpl-Swift.gitimport Purpl
let plusEntitlement = PurchaseEntitlement(identifier: "plus")
let monthlyProduct = PurchaseProduct(
productIdentifier: "time.plus.monthly",
entitlementIdentifier: plusEntitlement.identifier
)
let yearlyProduct = PurchaseProduct(
productIdentifier: "time.plus.yearly",
entitlementIdentifier: plusEntitlement.identifier
)
let purchaseConfiguration = PurchaseConfiguration(
entitlements: [plusEntitlement],
products: [monthlyProduct, yearlyProduct]
)
Purchases.configure(purchaseConfiguration)let customerInfo = try await Purchases.shared.customerInfo()
if customerInfo.isEntitlementActive("plus") {
enablePremiumFeatures()
}SDK with the Purpl service
Manage sales configuration and customer access on the web while the app loads the active configuration by paywall identifier.
- Create an application and connect its store in Purpl.
- Map products to entitlements, then create a catalog and paywall.
- Configure the app in server mode and pass the paywall identifier created on the web.
import Purpl
import PurplUI
Purchases.configure(entitlementMode: .server)
PaywallView(paywallIdentifier: "standard") {
PremiumMarketingContent()
}Server API
Use an application API credential when your trusted server needs account linking or entitlement lookup.
- Create an application API credential in Purpl.
- Keep the credential on your trusted server and never include it in the app.
- Call the required customer or entitlement endpoint with Bearer authentication.
cURL
curl 'https://api.purpl.sh/v1/customers/user-123/entitlements' \
--header 'Authorization: Bearer <application-api-credential>'