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

# Asva AI Quickstart: From Zero to Live in 5 Minutes

> Run a Readiness Score, generate and publish your UCP manifest, and install the Asva attribution snippet — all in under 5 minutes.

This guide walks you through the fastest path to agentic commerce readiness: audit your domain, generate your UCP manifest, publish it, and install the attribution snippet. By the end you'll have a live `.well-known/ucp` file and AI-sourced sessions appearing in your analytics.

## Before you start

You need:

* Your store domain (e.g. `yourstore.com`)
* An Asva AI API key — get one at [asva-ai.com/get-help](https://asva-ai.com/get-help)
* Ability to host a static file at `/.well-known/ucp` on your domain

Set your API key as an environment variable before running any of the examples below:

```bash theme={null}
export ASVA_API_KEY="asva_live_..."
```

<Steps>
  <Step title="Run a Readiness Score">
    Before implementing anything, audit your domain to see exactly what's missing. The Readiness Score returns a 0–100 score, a letter grade, and a prioritized list of gaps to close.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://asva-ai.com/api/audit \
        -H "Authorization: Bearer $ASVA_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"domain": "yourstore.com"}'
      ```

      ```typescript TypeScript theme={null}
      import Asva from '@asva-ai/sdk'

      const client = new Asva({ apiKey: process.env.ASVA_API_KEY })

      const result = await client.audit.run({
        domain: 'yourstore.com'
      })

      console.log(result.score)   // overall readiness score 0-100
      console.log(result.gaps)    // array of issues to fix
      ```

      ```python Python theme={null}
      import asva_ai

      client = asva_ai.Asva(api_key=os.environ["ASVA_API_KEY"])

      result = client.audit.run(domain="yourstore.com")
      print(result.score)
      print(result.gaps)
      ```
    </CodeGroup>

    **Example response:**

    ```json theme={null}
    {
      "domain": "yourstore.com",
      "score": 42,
      "grade": "C",
      "gaps": [
        { "id": "well_known_missing", "severity": "critical", "label": ".well-known/ucp not found" },
        { "id": "product_schema_incomplete", "severity": "high", "label": "Product JSON-LD schema missing on 6 pages" },
        { "id": "dark_traffic_untracked", "severity": "medium", "label": "Asva attribution snippet not detected" }
      ],
      "breakdown": {
        "discoverability": 60,
        "catalog": 45,
        "checkout": 30,
        "attribution": 0
      }
    }
    ```

    Review the `gaps` array — start with `critical` severity items first.
  </Step>

  <Step title="Generate your UCP manifest">
    Generate a compliant `.well-known/ucp` manifest for your domain. You need to provide the URLs for your catalog and checkout endpoints (you'll build these out fully in the [UCP guide](/ucp/getting-started)).

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://asva-ai.com/api/manifest \
        -H "Authorization: Bearer $ASVA_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "domain": "yourstore.com",
          "catalog_endpoint": "https://yourstore.com/api/ucp/products",
          "checkout_endpoint": "https://yourstore.com/api/ucp/checkout"
        }'
      ```

      ```typescript TypeScript theme={null}
      const manifest = await client.manifest.generate({
        domain: 'yourstore.com',
        catalogEndpoint: 'https://yourstore.com/api/ucp/products',
        checkoutEndpoint: 'https://yourstore.com/api/ucp/checkout'
      })

      // Write to /.well-known/ucp
      fs.writeFileSync('.well-known/ucp', JSON.stringify(manifest, null, 2))
      ```

      ```python Python theme={null}
      manifest = client.manifest.generate(
          domain="yourstore.com",
          catalog_endpoint="https://yourstore.com/api/ucp/products",
          checkout_endpoint="https://yourstore.com/api/ucp/checkout"
      )
      ```
    </CodeGroup>

    **Example response (your manifest file):**

    ```json theme={null}
    {
      "version": "1.0",
      "domain": "yourstore.com",
      "capabilities": {
        "product_catalog": {
          "endpoint": "https://yourstore.com/api/ucp/products",
          "format": "json",
          "version": "1.0"
        },
        "checkout": {
          "endpoint": "https://yourstore.com/api/ucp/checkout",
          "supported_methods": ["POST"],
          "version": "1.0"
        }
      }
    }
    ```

    Save this JSON — you'll publish it in the next step.
  </Step>

  <Step title="Publish the manifest">
    Host the manifest at `/.well-known/ucp` on your domain. This is how Google AI Mode, Gemini, and other agents discover your commerce capabilities.

    ```bash theme={null}
    # Static host / Vercel / Netlify
    mkdir -p public/.well-known
    curl -X POST https://asva-ai.com/api/manifest \
      -H "Authorization: Bearer $ASVA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"domain":"yourstore.com","catalog_endpoint":"...","checkout_endpoint":"..."}' \
      -o public/.well-known/ucp
    ```

    Then verify the file is publicly accessible:

    ```bash theme={null}
    curl https://yourstore.com/.well-known/ucp
    # Should return your manifest JSON
    ```

    <Warning>
      Serve this file with `Content-Type: application/json` and no authentication — it must be publicly readable. Any auth requirement will prevent agents from discovering your capabilities.
    </Warning>
  </Step>

  <Step title="Install the attribution snippet">
    Add this snippet to your storefront `<head>` to surface AI-sourced sessions as a distinct channel in GA4. Replace `YOUR_PROPERTY_ID` with the property ID from your Asva dashboard.

    ```html theme={null}
    <!-- Asva AI Attribution -->
    <script>
      (function(w,d,s,l,i){w[l]=w[l]||[];
      w[l].push({'asva.start': new Date().getTime(), event:'asva.js'});
      var f=d.getElementsByTagName(s)[0],
      j=d.createElement(s),dl=l!='asvaLayer'?'&l='+l:'';
      j.async=true;j.src='https://cdn.asva-ai.com/attribution.js?id='+i+dl;
      f.parentNode.insertBefore(j,f);
      })(window,document,'script','asvaLayer','YOUR_PROPERTY_ID');
    </script>
    ```

    <Info>
      The snippet analyzes session fingerprints, timing patterns, and UTM signals to identify AI-sourced visits that would otherwise appear as "Direct" in GA4. See [Dark traffic attribution](/attribution/dark-traffic) for how it works.
    </Info>
  </Step>

  <Step title="Re-run the score to confirm">
    Run the audit again after publishing your manifest and installing the snippet. A passing UCP manifest plus attribution snippet should bring your score above 60.

    ```bash theme={null}
    curl -X POST https://asva-ai.com/api/audit \
      -H "Authorization: Bearer $ASVA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"domain": "yourstore.com"}'
    ```

    If `well_known_missing` is gone from `gaps` and `attribution` is no longer 0 in the `breakdown`, you're on track. Continue with the [UCP guide](/ucp/getting-started) to build out your catalog and checkout endpoints.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Implement UCP endpoints" icon="plug" href="/ucp/getting-started">
    Build the catalog and checkout endpoints that back your manifest.
  </Card>

  <Card title="Implement ACP for ChatGPT" icon="robot" href="/acp/getting-started">
    Add ChatGPT Instant Checkout support via Agentic Commerce Protocol.
  </Card>

  <Card title="Set up attribution" icon="chart-line" href="/attribution/dark-traffic">
    See your AI-sourced traffic in GA4 and your own analytics.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/authentication">
    Full API docs — auth, readiness, manifest, attribution.
  </Card>
</CardGroup>
