Frak
Ce contenu n’est pas encore disponible dans votre langue.
enum FrakEntry point. Call initialize(_:) once, then use client.
Frak.initialize(FrakConfig(merchantId: "...", metadata: FrakMetadata(name: "Acme")))
let reward = try await Frak.client.rewards.best(RewardRequest(targetInteraction: "purchase"))Defined in: Sources/FrakSDK/Frak.swift:10
Type properties
Section titled “Type properties”client
Section titled “client”static var client: FrakClient { get throws }clientOrNull
Section titled “clientOrNull”static var clientOrNull: FrakClient? { get }Same as client, but nil instead of throwing: for a call site that would just try?
it anyway. Exists for parity with the Android surface, and for a call site that reads
better without try?.
isInitialized
Section titled “isInitialized”static var isInitialized: Bool { get }Type methods
Section titled “Type methods”initialize(_:)
Section titled “initialize(_:)”static func initialize(_ config: FrakConfig)parseReferralLink(_:)
Section titled “parseReferralLink(_:)”static func parseReferralLink(_ url: String) -> FrakContext?parseReferralLink(_:)
Section titled “parseReferralLink(_:)”static func parseReferralLink(_ url: URL) -> FrakContext?shutdown()
Section titled “shutdown()”static func shutdown() asyncTears the SDK down: cancels the background work it owns and drops the client so
initialize(_:) can run again with a different FrakConfig.
Not a privacy control — use FrakClient.setTrackingEnabled(_:) for that; shutting the
SDK down neither records a consent decision nor erases anything, so a merchant who calls
only this has stopped tracking for exactly as long as their process lives. Exists so a
host can deterministically release the SDK, and so the facade is testable at all.
Idempotent and safe before initialize(_:).