Skip to main content
The Figranium Swift SDK offers three authentication modes via the FigraniumAuthentication enum. 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

Use the convenience initializer or the designated initializer with .apiKey:
Client.swift
By default the SDK sends Authorization: Bearer <key>. You can also construct the enum directly:
Client.swift

Switch to x-api-key

Some deployments expect x-api-key instead of Authorization. Pass the header name explicitly:
Client.swift
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.swift
The login response sets session cookies in the shared URLSession, which are then sent on subsequent requests automatically.

Store keys in the Keychain

On Apple platforms, store API keys in the Keychain instead of hard-coding them or keeping them in UserDefaults:
Keychain.swift
Retrieve the key at runtime and pass it to the client initializer.

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, configuring AI providers, and managing proxies) are performed in the Figranium web UI.
Store API keys in environment variables or the Keychain. Never commit keys to source control or expose them in client-side code.

Client configuration

All available client options, including baseURL and timeout.

API key

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