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

> ## Agent Instructions
> For new direct REST integrations, use the v2026-04 surfaces. The @fluid-app FairShare SDK continues to use its own published public-v2025-06 contract.
> Authenticate with the header Authorization: Bearer <token>; public storefront read endpoints require no auth.
> Lists use cursor pagination via the page[cursor] and page[limit] query params; follow meta.pagination.next_cursor until it is null.
> Never use /api/company/v1 or /api/v1 paths, page/per_page params, or offset pagination — they are legacy.
> The OpenAPI specs under api-reference/ are the authoritative contracts; prefer them over prose when in doubt. api-reference/storefront-v2026-04.yaml covers the v2026-04 storefront surface (/api/v202604/... paths); api-reference/auth-v0.yaml covers the unversioned auth surface (/api/... paths — authentication, MFA, social auth, and token exchange); api-reference/checkout-v2026-04.yaml covers the v2026-04 checkout surface (/api/checkout/v2026-04/... paths — carts, cart auth, discounts, items, subscriptions, orders, enrollments, and store config); api-reference/public-v2025-06.yaml covers the Public SDK surface used by the @fluid-app FairShare SDK, including its parallel cart lifecycle, browser integrations, versioned payment callbacks, unversioned public utilities, and the cart price-override operation; api-reference/payment-v2026-04.yaml covers the v2026-04 payment gateway admin surface (/api/payment/v2026-04/... paths, bearer-authenticated — gateway CRUD, gateway purchase/authorize/$0-verify, transaction list/show and capture/void/credit, and merchant payment configuration); api-reference/payments-v2026-04.yaml covers the v2026-04 cart payment surface (/api/payments/v2026-04/carts/{cart_token}/... paths, authenticated by the cart token in the path with no bearer — payment-method selection, VGS card tokenization, 3D Secure verification, and PayPal/Braintree/Klarna/Apple Pay flows); api-reference/commerce-v2026-04.yaml covers the v2026-04 commerce order-editing surface (/api/v202604/orders/{order_id}/edits paths, bearer-authenticated — post-checkout order edits that atomically insert items and add adjustments/discounts, with an optional dry-run preview); api-reference/webhooks-v0.yaml covers the unversioned webhooks surface (/api/... paths — webhook registration, delivery payloads, callback registrations, company events, and webhook/callback schemas).
> Successful responses wrap the resource payload alongside a top-level integer status and a meta object.

# FairShare SDK: Attribution and Commerce for Any Website

> FairShare SDK adds sales rep attribution, cart management, lead capture, and media widgets to any website using a single script tag.

FairShare is Fluid's attribution and commerce SDK. Add one script tag to use rep-attribution signals, a cart widget, lead capture, and media components without rebuilding your existing site.

## Key Capabilities

<CardGroup cols={2}>
  <Card title="Attribution Tracking" icon="crosshairs">
    Supply share GUIDs, rep IDs, email addresses, usernames, or external identifiers and inspect the attribution that FairShare resolves for the session.
  </Card>

  <Card title="Cart Management" icon="cart-shopping">
    Add and remove products, adjust quantities, apply subscription plans, and send shoppers to checkout — all through a simple JavaScript API or declarative HTML attributes. A pre-built cart widget UI is included.
  </Card>

  <Card title="Lead Capture" icon="envelope">
    Collect prospect information with a customizable form widget that slots into any page layout. Submit leads programmatically or let the widget handle the UI entirely.
  </Card>

  <Card title="Media" icon="photo-film" href="/sdk/media">
    Embed product videos and media libraries as inline players or popover overlays. Fetch media metadata via JavaScript to build fully custom playback experiences.
  </Card>

  <Card title="Analytics" icon="chart-line">
    Fire custom events against the Fluid attribution pipeline, inspect the active attribution record, and retrieve session tokens for cross-system correlation.
  </Card>
</CardGroup>

## How Attribution Works

When FairShare loads, it checks the configured attribution signals in priority
order. The first signal that resolves wins.

| Priority | Signal              | How it's set                             |
| -------- | ------------------- | ---------------------------------------- |
| 1        | `data-share-guid`   | Unique GUID from a rep's share link      |
| 2        | `data-fluid-rep-id` | Numeric Fluid rep ID                     |
| 3        | `data-email`        | Rep's email address                      |
| 4        | `data-username`     | Rep's Fluid username                     |
| 5        | `data-external-id`  | Your own external identifier for the rep |

Read the active result with `window.FairShareSDK.getAttribution()`. The SDK
reuses its stored attribution state as the visitor moves between pages on the
same domain.

<Tip>
  Browser storage does not cross domain boundaries. Configure an attribution
  signal independently on each domain that runs FairShare.
</Tip>

## Framework Support

FairShare works with any website — static HTML, server-rendered pages, or JavaScript-heavy single-page apps. Because it loads as a plain `<script>` tag, you do not need a build system, a package manager, or a specific frontend framework.

| Environment           | How to install                                             |
| --------------------- | ---------------------------------------------------------- |
| Plain HTML            | Add the `<script>` tag to your `<head>`                    |
| React / Next.js       | Load the script in your root layout or via `next/script`   |
| Vue / Nuxt            | Add to `nuxt.config` scripts or your root layout component |
| Angular               | Reference from `index.html` or use `DOCUMENT` injection    |
| Webflow / Squarespace | Paste into the site-wide custom code section               |
| Any other platform    | Any environment that allows custom `<script>` tags works   |

<Tip>
  You can install FairShare on any site where you control the page's script
  tags, including landing pages and partner storefronts.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/sdk/installation">
    Add the script tag and configure attribution for your site.
  </Card>

  <Card title="Cart API" icon="code" href="/sdk/cart-api">
    Explore the full JavaScript cart API and declarative HTML controls.
  </Card>

  <Card title="Components" icon="puzzle-piece" href="/sdk/components">
    Browse the cart, lead capture, and media web components.
  </Card>

  <Card title="Media" icon="photo-film" href="/sdk/media">
    Listen for playback events and configure media calls to action.
  </Card>
</CardGroup>
