setup-sdk
- Javascript
- Kotlin
- Swift
npm i @loginid/websdk3
Import and initialize an instance:
import { LoginIDWebSDK } from "@loginid/websdk3";
const lid = new LoginIDWebSDK({
baseUrl: process.env.LOGINID_BASE_URL,
});
First, ensure you have the Maven Central repository in your project's settings.gradle.kts file:
repositories {
google()
mavenCentral()
}
Next, add the SDK and required dependencies to your app module's build.gradle.kts:
dependencies {
// LoginID SDK
implementation("io.loginid:auth:1.1.0")
}
Import the class within your application:
import io.loginid.auth
class MainActivity : AppCompatActivity() {
val lid = LoginIDAuth(this, "<LOGINID_BASE_URL>")
override fun onCreate() {
super.onCreate()
// Additional setup...
}
}
To obtain the SDK:
- Go to the LoginID Dashboard and select one of your apps.
- Open the Get Started section and choose the iOS icon.
- Follow the instructions to download the binary
xcframeworkfile and include it in your project.
Configure the singleton instance of LoginIDSDK with a base URL during the app's launch in the App struct initializer.
import SwiftUI
import LoginID
@main
struct MyApp: App {
init() {
let baseUrl = "<BASE_URL>"
// Initialize the singleton instance
LoginIDSDK.shared.configure(baseUrl: baseUrl)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}