Skip to content

Frak

object Frak

Entry point. Call initialize once from Application.onCreate, then use client.

Java callers use Frak.getClient() and the *Async twin of every suspending member.

NameSummary
clientval client: FrakClient
clientOrNullval clientOrNull: FrakClient?
Same as client, but null instead of throwing.
isInitializedval isInitialized: Boolean
Whether initialize has run. For merchants guarding optional integrations.
NameSummary
initializefun initialize(context: Context, config: FrakConfig)
Non-blocking, does no I/O, never throws. Second call is a no-op; first config wins.
parseReferralLinkfun parseReferralLink(url: String): FrakContext?
Pure and static; callable before initialize. Only decodes — does not track arrival.
shutdownsuspend fun shutdown()
Tears the SDK down: cancels background coroutines, unregisters the deep-link observer, and drops the client so initialize can run again. Not a privacy control — use FrakClient.setTrackingEnabled for that. Idempotent; Java uses shutdownAsync.
shutdownAsyncfun shutdownAsync(): CompletableFuture<Void?>
shutdown for Java. Runs on its own scope, not the client’s, which shutdown() cancels. Blocking it from the main thread throws rather than deadlocking; sequence a following initialize off the future (thenRun) rather than beside it, or the new client races the old one’s teardown.