Docs/API Reference/OctetSdk

OctetSdk

The handle returned by Octet.start(...). Holds the predicate surface (loc) and a snapshot of license state (licenseStatus).

Shape

public final class OctetSdk: @unchecked Sendable {
    public let loc: OctetLoc
    public internal(set) var licenseStatus: LicenseStatus?
}
class OctetSdk {
    val loc: OctetLoc
    var licenseStatus: LicenseStatus?
        internal set
}

licenseStatus is optional in the type. Callers that obtained sdk via Octet.start(...) always see a non-nil value, since start attaches it before returning.

loc. The predicate surface.

OctetSdk.loc is the only way to issue a predicate query. See Predicates for isWithin, isOutside, contains.

licenseStatus. Current license snapshot.

Read synchronously at any time. See License Types for the field shape.

if let status = sdk.licenseStatus {
    print("\(status.state): \(status.daysUntilHardStop ?? -1) days left")
}
sdk.licenseStatus?.let { status ->
    println("${status.state}: ${status.daysUntilHardStop ?: -1} days left")
}

Lifecycle notes

  • The SDK does not expose a stop() or shutdown() at v1. The proof pipeline runs for the lifetime of the process. The system shuts it down with the process.
  • Calling Octet.start(...) a second time within the same process is not supported in v1. Hold the first OctetSdk for as long as you need predicates.
  • OctetSdk is Sendable (Swift) and thread-safe to use from any coroutine context (Kotlin). The predicates serialize internally.

See also