Documentation Index
Fetch the complete documentation index at: https://docs.synheart.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Synheart Behavior Swift/iOS SDK captures digital interaction events on-device — the eightBehaviorEventType cases are scroll, tap, swipe, appSwitch, notification, call, typing, and clipboard — and aggregates them into per-session summaries. Behavior is content-free — no text, no screen content, no PII.
The SDK is an input layer: it produces events and session summaries. Higher-level human-state inference (focus, distraction, HSI fusion) is performed downstream by Synheart Core when behavior is fed into it.
Installation
Swift Package Manager
Add to yourPackage.swift or in Xcode (File → Add Packages…):
Requirements
- iOS 12.0+
- Swift 5.0+
- Xcode 12.0+
Quick Start
Typing: clipboard and correction rates
The typing session summary includesclipboardActivityRate and correctionRate, derived from backspace/copy/paste/cut event counts emitted by the SDK.
- Backspace/correction: Inferred from text length decrease. Cut is not counted as backspace.
-
Copy/paste/cut: The SDK does not observe the system clipboard. Call:
behavior.recordCopy()behavior.recordPaste()behavior.recordCut()
UITextField/UITextViewthat overridescopy(_:),paste(_:),cut(_:)). The Example app uses BehaviorTrackingTextField for this.
Event behavior
- Taps and long press: Not counted when a text field or text view is first responder (keyboard open), so typing is not double-counted as taps.
- Typing events: Include speed, cadence, burstiness, cadence variability, gap ratio, activity ratio, and backspace/copy/paste/cut counts.
API summary
| Method / property | Description |
|---|---|
initialize() | Initialize the SDK |
startSession(sessionId?) | Start a session; returns session ID |
endSession(sessionId) | End session and return BehaviorSessionSummary |
setEventHandler(_:) | Set callback for real-time events |
recordCopy() / recordPaste() / recordCut() | Report clipboard actions for the typing summary |
getCurrentStats() | Current rolling statistics |
getSessionEvents() | Events for the current session |
Resources
- Repository: synheart-behavior-swift
- Integration guide: INTEGRATION.md