AFCoreConfig

class AFCoreConfig(baseUrl: String, clientId: String, clientSecret: String, enableLogging: Boolean, logLevel: AFLogLevel, enableHttpLogging: Boolean, httpLogLevel: AFLogLevel, supportsManualSteps: Boolean, heartbeatEnabled: Boolean?, connectTimeoutMillis: Long, requestTimeoutMillis: Long, socketTimeoutMillis: Long, cacheEnabled: Boolean, cacheTtlMillis: Long, cacheMaxEntries: Int, maxNetworkRetries: Int, tokenRefreshLeadTimeMillis: Long, outboxMaxEntries: Int, outboxMaxAgeMillis: Long, outboxFlushIntervalMillis: Long, smartWalkingSyncIntervalMillis: Long, healthLookbackDays: Int, heartbeatForegroundThrottleMillis: Long, heartbeatBackgroundThrottleMillis: Long)

Library-stable configuration for AFCore initialization. Not a data class to preserve binary/source compatibility across releases.

When clientId and clientSecret are required

Both fields default to empty string ("") when not provided through the builder, and initialize() accepts that without complaint. Empty strings are coerced to null at the storage layer, so downstream "client credentials not set" guards behave consistently.

Which credentials each auth method needs:

Auth methodclientIdclientSecret
authenticateWithCredentials (username/password)not required — login, refresh, and revoke all run through the mobileapi/authentication endpoints with the username/password and refresh token alonenot required
signInOrCreateMember (external user id)requiredrequired
authenticateWithTokens (host-injected)required for /auth/refresh on 401not required — flow never calls /auth/token and logout()'s server-side revoke fails silently while local state still clears

Members who enrolled through the Enrollment Web Portal authenticate with authenticateWithCredentials and are already provisioned — they need no client credentials at all, so the SDK can be initialized with just a baseUrl.

Consumers integrating only via authenticateWithTokens can ship without bundling clientSecret in the mobile app. They still need a clientId if they want the SDK to attempt /auth/refresh on 401 before emitting SessionState.SESSION_EXPIRED. With no clientId the SDK skips refresh entirely and emits SESSION_EXPIRED on the first 401, which is the right behavior when the host owns auth end-to-end.

Constructors

Link copied to clipboard
constructor(baseUrl: String, clientId: String, clientSecret: String, enableLogging: Boolean, logLevel: AFLogLevel, enableHttpLogging: Boolean, httpLogLevel: AFLogLevel, supportsManualSteps: Boolean, heartbeatEnabled: Boolean?, connectTimeoutMillis: Long, requestTimeoutMillis: Long, socketTimeoutMillis: Long, cacheEnabled: Boolean, cacheTtlMillis: Long, cacheMaxEntries: Int, maxNetworkRetries: Int, tokenRefreshLeadTimeMillis: Long, outboxMaxEntries: Int, outboxMaxAgeMillis: Long, outboxFlushIntervalMillis: Long, smartWalkingSyncIntervalMillis: Long, healthLookbackDays: Int, heartbeatForegroundThrottleMillis: Long, heartbeatBackgroundThrottleMillis: Long)

Types

Link copied to clipboard
class Builder
Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard

Whether the in-memory GET response cache is enabled.

Link copied to clipboard

Maximum number of cached GET responses retained before LRU eviction.

Link copied to clipboard

Time-to-live for cached GET responses, in milliseconds.

Link copied to clipboard

Connection-establishment timeout for SDK HTTP requests, in milliseconds.

Link copied to clipboard
Link copied to clipboard

Whether HTTP request/response logs are emitted. Independent of enableLogging.

Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

How many days back the SDK probes for health data when establishing step/permission state. Apple platforms only — Android (Health Connect) uses its own aggregate query window and ignores this value.

Link copied to clipboard

Minimum spacing between background (geofence-triggered) heartbeats, in milliseconds.

Link copied to clipboard

Whether the location-tracking heartbeat is enabled for this install.

Link copied to clipboard

Minimum spacing between foreground-triggered heartbeats, in milliseconds.

Link copied to clipboard

Minimum severity for HTTP request/response logs. Independent of logLevel.

Link copied to clipboard
Link copied to clipboard

Number of automatic retries for transient failures (5xx responses and network I/O errors) on idempotent GET requests. 0 disables retries.

Link copied to clipboard

Target cadence for the periodic background outbox flush, in milliseconds. On Android this drives the WorkManager periodic interval; on iOS it is a lower-bound hint for the opportunistic BGTaskScheduler window.

Link copied to clipboard

Maximum age of an offline outbox event before it is discarded, in milliseconds.

Link copied to clipboard

Maximum number of offline events retained in the outbox before the oldest are dropped.

Link copied to clipboard

End-to-end request timeout (including refresh/retry) for SDK HTTP requests, in milliseconds.

Link copied to clipboard

Target cadence for periodic SmartWalking step sync, in milliseconds. Android only — on iOS, SmartWalking sync is HealthKit-observer driven and this value is ignored.

Link copied to clipboard

Per-socket read/write inactivity timeout for SDK HTTP requests, in milliseconds.

Link copied to clipboard

Whether manually-entered step samples should be included in step / activity aggregates. Defaults to false — the SDK only counts automatically-tracked data so a member can't inflate their totals by typing steps into the Health app.

Link copied to clipboard
Link copied to clipboard

How long before an access token's expiry the SDK proactively refreshes it, in milliseconds. Larger values refresh earlier (more resilient to going offline near expiry); smaller values squeeze more life out of each token.

Link copied to clipboard
open override fun toString(): String