> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spikeapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Get started with Spike API - your gateway to health and fitness data integration

# Getting Started with Spike API

Spike API provides a powerful platform for integrating health and fitness data from various providers like Garmin, Fitbit, and more. This guide will help you understand the key differences between using our API directly versus using our SDK.

## Spike API Overview

The Spike API enables seamless integration with health and fitness data providers through:

* Secure authentication using HMAC signatures
* Comprehensive endpoints for data access
* Provider integration management
* User authentication and data management

<Frame>
  <img src="https://mintcdn.com/trial-7e3c8695/tLxMhymXagiR2q29/images/oauth_user_flow.webp?fit=max&auto=format&n=tLxMhymXagiR2q29&q=85&s=3b06295009ba309e5d1f6d110184b443" alt="hmac key" width="1280" height="640" data-path="images/oauth_user_flow.webp" />
</Frame>

## API vs SDK: Choosing Your Integration Path

The API offers robust control and server-side processing, while the SDK simplifies integration with automatic handling of common tasks.

### Using the API Directly

```mermaid theme={null}
sequenceDiagram
  autonumber

  %% Group client actors
  box rgb(220,240,255) Client Side
    participant ClientApp as Client<br/>Application
    participant ClientServer as Client<br/>Server
  end

  %% Group platform actors
  box rgb(255,231,247) Spike Platform
    participant SpikeSDK as Spike<br/>SDK
    participant SpikeAPI as Spike<br/>API
  end

  %% Group provider actors
  box rgb(255,255,220) External Data
    participant Provider as Data<br/>Provider
  end

  %% Main flow starts
  Note right of ClientApp: User requests integration<br/>with a data provider

  ClientApp->>+SpikeSDK: Request provider integration
  SpikeSDK->>+SpikeAPI: Initiate integration process
  deactivate SpikeSDK

  SpikeAPI->>Provider: Integrate with provider
  Note right of Provider: Integration established<br/>Provider syncs data

  Provider-->>SpikeAPI: Continuously sync data

  rect rgb(240,255,240)
    SpikeAPI->>ClientServer: Send webhook event (new data)
    ClientServer->>+SpikeAPI: Query new data details
    SpikeAPI-->>-ClientServer: Return integrated data
  end

  Note over SpikeAPI,Provider: Ongoing data synchronization
  deactivate SpikeAPI
```

<p>Ideal for scenarios where:</p>

<ul>
  <li>Data needs to be available for central processing on a server</li>
  <li>Developers require fine-grained control over data handling</li>
  <li>Custom server-side authentication flows are necessary</li>
</ul>

<Note>
  For detailed API documentation, visit our [API
  Documentation](/api-docs/overview)
</Note>

### Using the SDK

<h3>SDK Integration</h3>

```mermaid theme={null}
sequenceDiagram
  participant ClientApp as Client Application
  participant SpikeSDK as Spike SDK
  participant SpikeAPI as Spike API
  participant Provider as Data Provider
  ClientApp->>SpikeSDK: Request to Integrate with Provider
  activate SpikeSDK
  SpikeSDK->>SpikeAPI: Start Provider Integration Process
  deactivate SpikeSDK
  SpikeAPI->>Provider: Establish Integration
  Provider->>SpikeAPI: Continuously Synchronize Data
  ClientApp->>SpikeSDK: Request Data Retrieval
  activate SpikeSDK
  SpikeSDK->>SpikeAPI: Forward Data Query
  deactivate SpikeSDK
  SpikeAPI->>ClientApp: Deliver Retrieved Data
```

<p>Best suited for applications where:</p>

<ul>
  <li>Data is primarily used within the context of an app</li>
  <li>Simplified integration with minimal setup is preferred</li>

  <li>
    Automatic handling of authentication and error management is beneficial
  </li>
</ul>

<Note>
  For detailed SDK documentation, visit our [SDK
  Documentation](/sdk-docs/overview)
</Note>
