Publish Score iOS SDK 0.2.0

This commit is contained in:
bdot
2026-10-02 14:28:42 -04:00
parent ca717e4656
commit 411afa70a2
5 changed files with 111 additions and 57 deletions

View File

@@ -13,6 +13,7 @@ public final class ScoreClient {
/// - Parameters:
/// - endpoint: middleware base URL; events POST to `<endpoint>/api/tracking/website`.
/// - initialConsent: defaults to "none" — nothing fires until `setConsent(...)`.
/// - pii: field-level PII handling (#482), scrubbed before events are queued on the device.
public init(
publishableKey: String,
siteId: String,
@@ -22,7 +23,8 @@ public final class ScoreClient {
os: String? = nil,
device: String? = nil,
locale: String? = nil,
initialConsent: ConsentState = ConsentState.companion.NONE
initialConsent: ConsentState = ConsentState.companion.NONE,
pii: PiiOptions? = nil
) {
let config = TrackerConfig(
publishableKey: publishableKey,
@@ -31,7 +33,7 @@ public final class ScoreClient {
sdk: SdkInfo(name: "@3halves-labs/score-tracker-ios", version: sdkVersion),
device: DeviceDescriptor(os: os, device: device, appVersion: appVersion, locale: locale)
)
tracker = IosPlatformKt.doNewScoreTracker(config: config, initialConsent: initialConsent)
tracker = IosPlatformKt.doNewScoreTracker(config: config, initialConsent: initialConsent, pii: pii)
}
// MARK: - Consent (wire to your CMP / OneTrust)