Skip to main content
The Cloneable SDK uses SwiftUI. For UIKit apps, use a UIHostingController.

Initialize the SDK

Initialize one CloneablePlatform instance as a StateObject.

Set authentication parameters

Set authType to .api. Provide an API key. API key authentication grants its associated permissions.
Create an API key in API keys.
JWT authentication is unsupported. Use API key authentication.

Pass the SDK to child views

Pass the SDK through the view hierarchy as an environment object. Child views can then access it:

Authenticate

The SDK exposes properties and helpers for authentication status.

API based auth

Pass your API key to the CloneablePlatform initializer.

Auth status

Read userAuthed from CloneablePlatform to determine whether the user is authenticated. For example: