For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

initialize is idempotent — a second call is a no-op. It also accepts two optional parameters:

For a normal integration, call Onside.initialize() with no arguments.

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:

You're set up

OnsideKit is now initialized and ready. Next:

Last updated

Was this helpful?