Sleep Cycle SDK

iOS Release Notes

Version 1.4.0

New Features

  • Telemetry options: initialize(...) accepts a telemetry: TelemetryConfig parameter with two independent switches, analytics and errorReporting, putting the telemetry the SDK sends under your app's control.

API Changes

  • Added telemetry: TelemetryConfig parameter to initialize(...), defaulting to TelemetryConfig(analytics: false, errorReporting: true).

Improvements

  • Various bug fixes and improvements.

Version 1.3.2

Bug fixes and improvements.

Version 1.3.1

Improvements

  • Sleep score stability: Fixed a crash in AnalysisResult.toSleepScoreHistoryEntry() and SleepScoring.compute(...) for short sessions where no sleep was detected.
  • Various bug fixes and improvements.

Version 1.3.0

New Features

  • Slim SDK variant: The Swift package now vends a second product, SleepCycleSDKSlim, which ships without the embedded ML models and downloads the ones your granted features require on the first initialize(...), taking the framework embedded in your app from roughly 16 MB to roughly 1.6 MB. Both products vend the SleepCycleSDK module, so switching between them takes no code changes. See the Installation section of the iOS guide.
  • Download progress: initialize(...) accepts an onDownloadProgress callback reporting model download progress in 0...1.
  • Updating the smart alarm during a session: updateSmartAlarm(config:) replaces the alarm on the active session, adds one to a session started without an alarm, or cancels it when passed nil.
  • Clearing persisted state: SleepCycleSdk.clear() deinitializes the SDK and wipes the cached authorization token and any downloaded models.
  • Discarding resumable sessions: clearActiveSessions() ends the sessions resumeAnalysis(...) would pick up, making isResumePossible() return false again.

API Changes

  • Added onDownloadProgress: (@Sendable (Double) -> Void)? parameter to initialize(...), which now blocks until the models required by the granted features are available locally.
  • Added SleepCycleSdkError cases for resource provisioning: .resourceUnavailable(_:), .resourceDownloadFailed(_:), .modelUnavailable(_:), .modelNotProvisioned(_:), and .modelIntegrityCheckFailed(_:).
  • startMultiChannelAnalysis(...) now throws SleepCycleSdkError.invalidInput when a smartAlarmConfig is given for a channel other than .primary.
  • deinitialize() no longer ends active sessions. It stops the data source and leaves them resumable via resumeAnalysis(...).

Improvements

  • Various bug fixes and improvements.

Version 1.2.1

Improvements

  • Improved audio classification: Updated audio classification model for improved sound detection.

Version 1.2.0

New Features

  • Smart alarm: Configure a wake-up window via SmartAlarmConfig and observe alarm lifecycle events through the new smartAlarmStream: AsyncStream<SmartAlarmEvent>. Event types are .armed and .triggered(reason), with reasons .optimalWakeUp, .userInteraction, and .windowEnd. Smart alarm is gated behind the smartAlarm feature and only supported on the primary channel.
  • Stereo channel separation: New ChannelSeparationConfig controls how stereo audio channels are assigned to analysis channels, with built-in presets .bedSideMics, .centeredMicArray, and .detectionStrengthOnly.
  • Configurable audio input: New AudioInputConfig selects the audio format (mono/stereo) and a preferred input device when creating a live data source via createLiveDataSource(audioConfig:).
  • Sleep score: Compute a per-night sleep score with SleepScoring.compute(result:history:dateOfBirth:chronoType:), which returns a SleepScore with total, duration, quality, and routine subscores (each 0.0–1.0). Build history entries from a completed result via AnalysisResult.toSleepScoreHistoryEntry() and derive the user's ChronoType with SleepScoring.identifyChronoType(history:).
  • Extended audio events: New extendedAudioEvents feature flag exposes additional EventType values beyond the standard set. EventType.standardTypes and EventType.extendedTypes group the available sets.
  • Real-time sleep staging in results: AnalysisResult now includes realTimeSleepStageIntervals, the sleep stages emitted live during the session (in addition to the post-session sleepStageIntervals).

API Changes

  • The channel-aware start method is now startMultiChannelAnalysis(channel:config:at:smartAlarmConfig:tag:) and accepts a smartAlarmConfig: parameter.
  • stopAnalysis(channel:) is now stopAnalysis(sessionId:), stopping a session by its UUID.
  • resumeAnalysis() now returns [ResumedSession] (session ID, channel, and smart alarm config per resumed session) instead of [AnalysisChannel: UUID].
  • Added forceTokenRefresh: Bool parameter to initialize() to force a fresh token fetch even if a cached token exists.
  • Added channelSeparationConfig: ChannelSeparationConfig parameter to startAnalysis(...), startDataSource(...), and resumeAnalysis(...).
  • AudioEventListener.onAudioAnalysisBatchCompleted(...) now receives audioProbability: [EventType: Float], the per-batch probability for each event type. The rms: [Float] parameter has been replaced by dbSpl: [Float], providing A-weighted sound volume in dB SPL.
  • EventEndedInfo now includes an eventType: EventType property.
  • AnalysisResult now includes timeZone: TimeZone (captured at session start) and realTimeSleepStageIntervals: [SleepStageInterval].
  • The stream accessors (eventStream, breathingRateStream, errorStream, sleepStageStream, audioHealthStream, stateStream) and currentState are now async (get async).
  • Renamed SleepCycleSdkError.sessionAlreadyRunning to .channelAlreadyRunning, and added .featureNotEnabled(_:).
  • Added SleepCycleSdk.version returning the SDK version string.

Version 1.1.0

New Features

  • Multi-channel analysis: Analyze two channels simultaneously using stereo audio. New startDataSource(using:eventListeners:) / stopDataSource() methods separate the data source lifecycle from session lifecycles, with per-channel start via startAnalysis(channel:config:at:tag:) and per-session stop via stopAnalysis(channel:at:).
  • Audio health monitoring: New audioHealthStream: AsyncStream<AudioHealthUpdate> emits real-time audio input health status changes (.healthy, .flatline, .missingInput). AudioStatistics and AudioHealthInterval are included in the analysis result.
  • Session IDs on all public types: Event, BreathingRate, SleepStageInterval, AudioClip, and AudioHealthUpdate now include a sessionId: UUID property to identify which session they belong to.

API Changes

  • startAnalysis() now returns a UUID identifying the session.
  • Added tag: String? parameter to startAnalysis() for labeling sessions.
  • AudioEventListener.onAudioAnalysisBatchCompleted() now includes a sessionId: UUID parameter.
  • AnalysisResult now includes sleepStageIntervals, audioStatistics, and sessionId properties.
  • Added multiChannelAnalysis to SleepAnalysisFeatures.

On this page