Skip to main content

Initialize the SDK

To initialize the SDK, you need to provide an SdkConfig with your desired configuration.

SDK config builder

The minimum viable SdkConfig is SdkConfig.Builder().build(), although the following configurations are also available:

ConfigurationMethodDefault
API environmentsetApiEnvironmentProduction
Cloud auth tokensetCloudAuthToken-
Cloud refresh tokensetCloudRefreshToken-
Fusion hostsetFusionHosthttp://localhost:27700
Secure storagesetSecureStorageOverride-
Debug LoggingsetDebugLoggingfalse
info

If you initialize the SDK without a cloud auth token, you will need to either provide one manually through the context manager or call the login function to access most SDK functionalities.

Secure storage

By default, the SDK stores the context information on its own, as shown in the following table:

PlatformStorage
AndroidEncryptedSharedPreferences
JVMMemory
iOS / macOS / watchOSKeychain
JS / NodeLocalStorage
C# / PythonMemory
info

To override the default secure storage, you must implement the SecureStorage interface and pass the class through the setSecureStorageOverride function from SdkConfig builder.

Initialize

val sdkConfig = SdkConfig.Builder()
.setCloudAuthToken("AUTH_TOKEN")
.build()
val sdk = KDoordeckFactory.initialize(sdkConfig)