> ## 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.

# Quickstart

> Build your first Synheart integration

This guide takes you from a fresh machine to a working Synheart integration. Pick the track that matches what you're building.

## Pick a track

**Track A** if you want a single, fused human-state signal (focus, emotion, capacity, recovery, strain, sleep) — typically because you're building a wellness, productivity, or coaching app that already pulls data from a wearable and wants higher-level inference on top.

**Track B** if you only need one channel of data — wearable readings, behavior events, or session frames — and want to wire it into your own pipeline. No CLI, no runtime, no platform account.

<CardGroup cols={2}>
  <Card title="Track A — Synheart Core (HSI)" icon="microchip" href="#track-a">
    Multimodal human-state inference on-device. Requires CLI, platform account, and the runtime.
  </Card>

  <Card title="Track B — Standalone module" icon="cube" href="#track-b">
    Just `synheart_wear`, `synheart_behavior`, or `synheart_session`. No CLI required.
  </Card>
</CardGroup>

## Track A

Synheart Core (HSI).

Use this track when you want fused human-state output (focus, emotion, capacity, recovery, strain, sleep) from biosignals + behavior + phone context.

### 1. Install the CLI

```bash theme={null}
curl -fsSL https://synheart.sh/install | sh
```

Windows (PowerShell):

```powershell theme={null}
iwr -useb https://synheart.sh/install.ps1 | iex
```

Verify:

```bash theme={null}
synheart version
```

[Full install guide →](/setup/install-cli)

### 2. Create a platform account

Synheart is **invite-only**. [Request access](https://synheart.ai/work-with-us), then create your account at [platform.synheart.ai](https://platform.synheart.ai) (email + password or OAuth).

[Account setup →](/setup/create-account)

### 3. Authenticate the CLI

```bash theme={null}
synheart login
```

Follow the device-flow prompt to sign in. Confirm:

```bash theme={null}
synheart whoami
```

[Authentication details →](/setup/authenticate)

### 4. Install the runtime

From your project root:

```bash theme={null}
synheart install runtime
```

This downloads the native HSI engine and writes `synheart.lock`. Commit the lockfile so teammates and CI can run `synheart sync`.

[Runtime install guide →](/setup/install-runtime)

### 5. Initialize Synheart Core

<AccordionGroup>
  <Accordion title="Flutter / Dart" icon="flutter">
    ```yaml theme={null}
    # pubspec.yaml
    dependencies:
      synheart_core: ^0.0.4
    ```

    ```dart theme={null}
    import 'package:synheart_core/synheart_core.dart';

    await Synheart.initialize(
      userId: 'anon_user_123',
      config: SynheartConfig(
        allowUnsignedCapabilities: true, // use capabilityToken in production
      ),
    );

    Synheart.onHSIUpdate.listen((hsiJson) {
      print('HSI: $hsiJson');
    });
    ```
  </Accordion>

  <Accordion title="Android (Kotlin)" icon="android">
    ```kotlin theme={null}
    // build.gradle.kts
    dependencies {
        implementation("ai.synheart:synheart-core:0.0.4")
    }
    ```

    ```kotlin theme={null}
    import ai.synheart.core.Synheart
    import ai.synheart.core.config.SynheartConfig

    Synheart.initialize(
        context = context,
        userId = "anon_user_123",
        config = SynheartConfig(allowUnsignedCapabilities = true),
    )

    Synheart.onHSIUpdate.collect { hsiJson ->
        println("HSI: $hsiJson")
    }
    ```
  </Accordion>

  <Accordion title="iOS (Swift)" icon="apple">
    ```swift theme={null}
    // Package.swift
    .package(url: "https://github.com/synheart-ai/synheart-core-swift.git", from: "0.0.4")
    ```

    ```swift theme={null}
    import SynheartCore
    import Combine

    var cancellables = Set<AnyCancellable>()

    try await Synheart.initialize(
        userId: "anon_user_123",
        config: SynheartConfig(allowUnsignedCapabilities: true)
    )

    Synheart.onHSIUpdate
        .sink { hsiJson in print("HSI: \(hsiJson)") }
        .store(in: &cancellables)
    ```
  </Accordion>
</AccordionGroup>

### 6. Test locally with mock data (optional)

```bash theme={null}
synheart local        # mock platform server (consent + ingest APIs)
synheart mock start   # mock wearable stream on ws://localhost:8787
```

[CLI reference →](/synheart-cli)

## Track B

Standalone module.

If you only need a single signal channel and don't need fused HSI output, install just that SDK. No CLI, account, or runtime needed.

<CardGroup cols={3}>
  <Card title="Synheart Wear" icon="watch" href="/synheart-wear/overview">
    Biosignals from Apple Watch, WHOOP, Garmin, Fitbit, BLE HRMs.
  </Card>

  <Card title="Synheart Behavior" icon="mobile" href="/synheart-behavior/overview">
    Tap, scroll, type, and motion patterns — content-free.
  </Card>

  <Card title="Synheart Session" icon="heart-pulse" href="/synheart-session/overview">
    Time-bounded sessions with HR + behavioral metrics on-device.
  </Card>
</CardGroup>

Quick example — `synheart_wear` in Flutter:

```yaml theme={null}
dependencies:
  synheart_wear: ^0.3.1
```

```dart theme={null}
import 'package:synheart_wear/synheart_wear.dart';

final synheart = SynheartWear(
  config: SynheartWearConfig.withAdapters({DeviceAdapter.platformHealth}),
);
await synheart.initialize();

synheart.streamHR(interval: const Duration(seconds: 5)).listen((m) {
  print('HR: ${m.getMetric(MetricType.hr)}');
});
```

## How it fits together

1. **CLI** authenticates you, manages the runtime artifact, and runs local mocks for development.
2. **Runtime** is the native on-device engine that computes HSI. The Core SDK loads it at startup.
3. **Core SDK** (Flutter / Kotlin / Swift) coordinates signal collection, drives the runtime, and exposes reactive streams.
4. **Modules** (`synheart_wear`, `synheart_behavior`, `synheart_session`) can be used standalone or composed under Core.

## Privacy posture

<CardGroup cols={3}>
  <Card title="On-device" icon="shield-check">
    Inference runs locally — no biosignal content leaves the device.
  </Card>

  <Card title="Consent-gated" icon="user-shield">
    Cloud uploads require explicit user consent and capability tokens.
  </Card>

  <Card title="Content-free" icon="eye-slash">
    No text, audio, screen content, or PII is ever captured.
  </Card>
</CardGroup>

## Next

<CardGroup cols={2}>
  <Card title="Synheart Core" icon="microchip" href="/synheart-core/overview">
    Architecture, HSI/HSV spec, capabilities, consent.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/synheart-cli">
    Mock streams, local platform, install, sync, receiver.
  </Card>

  <Card title="Modules" icon="cube" href="/synheart-wear/overview">
    Wear, Behavior, Session details.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/guides/troubleshooting">
    Common issues and fixes.
  </Card>
</CardGroup>
