Initializing the SDK
Initialize OnsideKit, register your callback URL scheme, and forward incoming URLs so the app-to-app login flow can complete.
Before you call any OnsideKit API, complete this one-time setup at app launch. It also enables the seamless app-to-app login flow, where the user authenticates in the Onside store app and is returned to your app.
The setup has five steps:
1. Allow your app to detect the Onside app
To start the app-to-app login, OnsideKit checks whether the Onside store app is installed (via canOpenURL). iOS requires you to declare the onside scheme you want to query in your Info.plist.
Add the onside scheme under Queried URL Schemes (LSApplicationQueriesSchemes):
<key>LSApplicationQueriesSchemes</key>
<array>
<string>onside</string>
</array>2. Declare your app's URL scheme
Your app needs its own URL scheme so the Onside store app knows where to send the user back. Register a unique scheme under URL Types (CFBundleURLTypes). Use a reverse-domain style to avoid collisions — for example com.yourapp.onside.
You can also set this in Xcode under Target → Info → URL Types.
3. Initialize the SDK
Call Onside.initialize() once at launch, before any other OnsideKit API. Calling an OnsideKit API before this logs a warning and leads to undefined behavior.
4. Provide your callback scheme to OnsideKit
Set Onside.callbackScheme to the exact scheme you declared in step 2 (shown in the snippet above). OnsideKit uses it to recognize the redirect coming back from the Onside store app.
5. Forward incoming URLs to OnsideKit
When the Onside store app redirects back to your app, pass the incoming URL to Onside.handle(url:). It returns true when the URL was an Onside callback that it consumed.
Implement the forwarding for your app's lifecycle:
Optional: external accounts
After initialization, native apps can assign Onside.externalLoginDelegate to supply their own account identifier. Keep the URL-scheme setup above if you want app-to-app login when external login falls back. See External Login for setup and purchase restrictions. JavaScript integrations configure external login through the bridge API.
You're set up
OnsideKit is now initialized and ready. Next:
Quick Start — a minimal end-to-end purchase flow
Authentication & User Account — how login works and how to read session state
The Onside Delegate — route SDK screens to a window scene and customize behavior
Last updated
Was this helpful?