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

# Key Concepts

> Learn the key concepts of Flock and how to integrate it with your application.

<Note>
  This guide explains the core concepts of Flock's referral system. For implementation details, refer to our SDK documentation.
</Note>

# Understanding Flock Integration

Flock is a referral system that helps you create and manage referral campaigns. A successful integration involves two main components:

<CardGroup cols={2}>
  <Card title="Client-Side Integration" icon="browser">
    Handle user-facing aspects of your referral program
  </Card>

  <Card title="Server-Side Integration" icon="server">
    Manage reward fulfillment and authentication
  </Card>
</CardGroup>

## Overview of a Referral Flow

<Steps>
  <Step title="Share">
    **Referrer** shares their unique referral code with friends
  </Step>

  <Step title="Sign Up">
    **Invitee** uses this code when signing up
  </Step>

  <Step title="Reward">
    When the invitee completes the required action (e.g., subscribes), eligible parties receive their rewards
  </Step>
</Steps>

## Key Integration Components

### 1. Client-Side Integration

The client-side integration handles the user-facing aspects of your referral program:

<AccordionGroup>
  <Accordion title="User Identification" icon="user">
    * Register users with Flock using your internal user IDs
    * Provide user details (email, name) to personalize the experience
    * Required before displaying any referral interfaces
  </Accordion>

  <Accordion title="Referrer Flow" icon="share">
    * Display a sharing interface for referrers to invite friends
    * Support various sharing methods (email, SMS, social media)
  </Accordion>

  <Accordion title="Invitee Flow" icon="user-plus">
    * **Web**: Automatically capture and validate referral codes from the URL
    * **Mobile**: Display a referral code input screen for manual code entry
    * Once validated, create a referral record in Flock to capture the referral flow
  </Accordion>
</AccordionGroup>

### 2. Server-Side Integration

<CardGroup cols={2}>
  <Card title="Authentication" icon="lock">
    * Secure API access using service keys
    * Environment-based configuration (test/production)
  </Card>

  <Card title="Reward Triggers" icon="gift">
    * Trigger rewards when invitees complete required actions
    * Support for various reward types (gift cards, credits, etc.)
    * See [Reward Triggers Guide](/docs/rewards)
  </Card>
</CardGroup>
