The iOS SDK is coming soon. This documentation is a preview.
Swift Package Manager
The Whop iOS SDK is distributed via Swift Package Manager. This is the recommended way to install the SDK.Step 1: Add Package Dependency
In Xcode, go to File → Add Package Dependencies… Enter the package URL:Step 2: Select Version
Choose the latest version or specify a version range:- Up to Next Major: Recommended for production
- Exact Version: For stability
- Branch: For development
Step 3: Import the SDK
Import Whop in your Swift files:Configuration
Initialize the SDK with a token provider that fetches authentication tokens from your backend:Backend Setup
Your backend needs to provide an endpoint that returns Whop tokens for authenticated users.Example: Next.js API Route
How it works
- Your iOS app calls the
tokenProviderclosure - The closure makes a request to your backend
- Your backend verifies the user’s session
- Your backend creates a Whop access token for that user
- The token is returned to the SDK
- The SDK uses this token for all chat operations
tokenProvider is called automatically when:
- The SDK first initializes
- A token expires and needs refresh
- A network request fails with 401
Next Steps
Embedded Chat
Start building with embedded chat

