Mobile SDKs
- Written for
- + Written for
- Deprecated
- + Deprecated
- Applies to
- + Applies to
Mobile SDKs
Native SDKs authenticate with a publishable key over FAPI and persist the session in platform-secure storage (Keychain / EncryptedSharedPreferences). They mirror @atlas/js: a bare frontendApi host is upgraded to https://. For React Native, see @atlas/react-native.
Swift (iOS / macOS)
Dependency-light Swift Package over FAPI (URLSession, async/await, Codable). Persists the session JWT + refresh to the Keychain.
// Package.swift
.package(url: "https://github.com/atlas-auth/atlas-swift", from: "0.1.0")
// or Xcode → File → Add Package Dependenciesimport Atlas
let atlas = AtlasClient(
publishableKey: "pk_live_…",
frontendApi: "accounts.your-domain.com" // bare host upgraded to https://
)
// Password sign-in: create attempt → attempt first factor → exchange ticket
let user = try await atlas.signIn(email: "ada@example.com", password: "…")
let me = try await atlas.currentUser()
try await atlas.refresh() // rotate the token before expiry / on a 401 retry
try await atlas.signOut() // revokes server-side and clears the KeychainKotlin / Android
OkHttp + coroutines + kotlinx.serialization. Publishes as net.atlasauth:atlas-android. create wires an encrypted token store namespaced by the publishable key.
// build.gradle.kts (app module)
dependencies {
implementation("net.atlasauth:atlas-android:0.1.0")
}import net.atlasauth.atlas.AtlasClient
val atlas = AtlasClient.create(
context = applicationContext,
publishableKey = "pk_live_…",
frontendApi = "accounts.your-domain.com",
)
lifecycleScope.launch {
val user = atlas.signIn(email = "ada@example.com", password = "…")
val me = atlas.currentUser()
atlas.refresh()
atlas.signOut()
}Flutter / Dart
Cross-platform FAPI client with the publishable key.
flutter pub add atlas_authimport 'package:atlas_auth/atlas_auth.dart';
final client = AtlasClient(
publishableKey: 'pk_live_…',
frontendApi: 'accounts.example.com', // bare host upgraded to https://
);
try {
final user = await client.signIn(email: 'ada@example.com', password: 'hunter2');
print('Signed in as ${user.firstName} (${user.id})');
} on AtlasException catch (e) {
if (e.code == 'form_password_incorrect') {
print('Wrong password: ${e.message}');
} else {
rethrow;
}
}Native sign-in helpers
The mobile SDKs support native identity flows over FAPI: Google One-Tap / Apple / Facebook Limited Login via POST /v1/client/sign_ins/id_token, passkeys (WebAuthn), and the standard email/password + MFA attempt flow. See Sign-in & sign-up.