Skip to content

FrakClient

class FrakClient

Everything the SDK can do. Obtained from Frak.client. Every suspending member has a *Async twin returning a CompletableFuture, since a Java caller cannot name a Continuation.

How failure is signalled, one tier per kind of answer:

TrackingApi is the one deliberate exception: it returns id.frak.sdk.core.FrakResult and never throws, because it is called from hot paths where a disabled-tracking refusal is expected rather than exceptional. A tier change is invisible to the ABI dump, so it needs a ! commit.

NameSummary
appLinkval appLink: AppLinkApi
Inbound referral links and the wallet app handoff.
configval config: ConfigApi
Config resolution and its live stream.
environmentval environment: FrakEnvironment
The stage this client talks to. Merchants never set it directly, see id.frak.sdk.core.FrakConfig.env.
metadataLangval metadataLang: FrakLanguage?
The merchant-supplied build-time language, for the same tier-3 copy. See metadataName.
metadataNameval metadataName: String?
The merchant-supplied build-time name. public only so :frak-sdk-ui can read it across the module boundary.
rewardsval rewards: RewardsApi
Campaigns and the single best reward to advertise.
sharingval sharing: SharingApi
Share link construction.
trackingval tracking: TrackingApi
Interaction and purchase tracking.
NameSummary
anonymousIdsuspend fun anonymousId(): String?
Anonymous id, or null when tracking is disabled or the device refused key material.
anonymousIdAsyncfun anonymousIdAsync(): CompletableFuture<String?>
anonymousId for Java.
isTrackingEnabledsuspend fun isTrackingEnabled(): Boolean
Whether tracking is currently allowed: FrakConfig.trackingEnabled AND the persisted runtime decision.
isTrackingEnabledAsyncfun isTrackingEnabledAsync(): CompletableFuture<Boolean>
isTrackingEnabled for Java.
resetAnonymousIdsuspend fun resetAnonymousId(): Boolean
Destroys the keypair so the next anonymousId mints a new identity.
resetAnonymousIdAsyncfun resetAnonymousIdAsync(): CompletableFuture<Boolean>
resetAnonymousId for Java.
setTrackingEnabledsuspend fun setTrackingEnabled(enabled: Boolean)
Turns tracking on or off at runtime and persists the decision for this install. false purges anything still queued, which can discard purchase events not yet sent; true cannot lift a build shipping trackingEnabled(false). Identity survives — see resetAnonymousId.
setTrackingEnabledAsyncfun setTrackingEnabledAsync(enabled: Boolean): CompletableFuture<Void?>
setTrackingEnabled for Java.