Skip to main content
The Figranium Kotlin SDK offers three authentication modes via the FigraniumAuthentication sealed interface. Every request is signed automatically based on the mode you choose when creating the client.

Authentication modes

Create an API key

Sign into the Figranium web UI and generate an API key from Settings. Copy the value once; you will not see it again.

Pass an API key

Create a client with FigraniumAuthentication.ApiKey.
Client.kt
By default the SDK sends Authorization: Bearer <key>. You can also pass a custom header name explicitly.

Switch to x-api-key

Some deployments expect x-api-key instead of Authorization. Pass the header name explicitly:
Client.kt
When the header is anything other than authorization, the SDK sends the raw key without a Bearer prefix.

Session authentication

For cookie-based sessions, authenticate with Session and call auth.login before making protected requests:
Client.kt
The login response sets session cookies in the OkHttpClient cookie jar, which are then sent on subsequent requests automatically.

Store keys securely

On Android, store API keys in the Android Keystore or EncryptedSharedPreferences instead of hard-coding them or keeping them in plaintext SharedPreferences. Retrieve the key at runtime and pass it to the client constructor.
SecureStorage.kt
On server-side JVM code, read keys from environment variables or a secrets manager and pass them directly to the constructor.

What API keys can access

API keys authenticate every task, execution, schedule, capture, browser, and execution endpoint exposed by the SDK. Server-administration operations (creating API keys, changing themes, and managing proxies) are performed in the Figranium web UI.
Store API keys in environment variables, Android Keystore, or a secrets manager. Never commit keys to source control or expose them in client-side code.

Client Configuration

All available client options, including baseUrl and timeoutMillis.

API Key

How Figranium API keys work and how to manage them from the web UI.