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

# Strapi

> Connect your Strapi CMS to search content

Enhance your chatbot with real-time access to your Strapi content. The Strapi integration allows your chatbot to search content types.

## Why Connect Strapi?

<CardGroup cols={2}>
  <Card title="Content Search" icon="magnifying-glass">
    Chatbot can search and retrieve Strapi content
  </Card>

  <Card title="Flexible Content Types" icon="layers">
    Works with custom content types and collections
  </Card>

  <Card title="API Token Auth" icon="lock">
    Secure authentication with API tokens
  </Card>
</CardGroup>

## Prerequisites

* Strapi 4.x or 5.x project
* Admin access to your Strapi dashboard
* API Token generated from your Strapi admin
* Content API permissions configured

## Setup Steps

<Steps>
  <Step title="Navigate to Integrations">
    Go to **Dashboard** → **Integrations** and find the Strapi card
  </Step>

  <Step title="Click Connect">
    Click **Connect Strapi** to open the connection form
  </Step>

  <Step title="Enter API URL">
    Enter your Strapi API URL (e.g., `https://cms.yoursite.com/api`)
  </Step>

  <Step title="Generate API Token">
    Create an API Token in your Strapi admin:

    <ol>
      <li>Log in to your Strapi admin dashboard</li>
      <li>Go to <strong>Settings</strong> → <strong>Global Settings</strong> → <strong>API Tokens</strong></li>
      <li>Click <strong>Create new API Token</strong></li>
      <li>Enter a name (e.g., "BubblaV Integration")</li>
      <li>Set token duration (recommended: Unlimited or long duration)</li>
      <li>Set token type to <strong>Read-only</strong> or <strong>Full access</strong></li>
      <li>Click <strong>Save</strong></li>
      <li>Copy the generated API Token (shown only once)</li>
    </ol>
  </Step>

  <Step title="Configure Content Permissions">
    Ensure your API Token has access to the content types you want to sync:

    <ol>
      <li>Go to <strong>Settings</strong> → <strong>Users & Permissions</strong> → <strong>Roles</strong> → <strong>Public</strong></li>
      <li>Or create a dedicated role for the integration</li>
      <li>Enable <strong>find</strong> and <strong>findOne</strong> permissions for desired content types</li>
    </ol>
  </Step>

  <Step title="Enter Credentials">
    Enter your API Token in the connection form
  </Step>

  <Step title="Verify Connection">
    Click <strong>Connect</strong>. The Strapi card should now show **Connected**
  </Step>
</Steps>

## Available Tools After Connection

| Tool                    | What It Does                | Example Query                 |
| ----------------------- | --------------------------- | ----------------------------- |
| `strapi_search_content` | Search Strapi content types | "Find articles about pricing" |

## Test Your Integration

Try these queries on your website:

* "What do you have about \[topic]?"
* "Show me articles about \[subject]"
* "Find content related to \[keyword]"

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication fails">
    <ul>
      <li>Verify your API Token is correct</li>
      <li>Check that the token hasn't expired</li>
      <li>Ensure the token type is set correctly (Read-only or Full access)</li>
      <li>Make sure you're including the full token without spaces</li>
    </ul>
  </Accordion>

  <Accordion title="Connection fails">
    <ul>
      <li>Verify your API URL is correct and accessible</li>
      <li>Check that Strapi is running and the API is available</li>
      <li>Ensure your site is not blocking API requests</li>
      <li>Try accessing `/api/articles` (or another endpoint) to test API availability</li>
    </ul>
  </Accordion>

  <Accordion title="Permission errors">
    <ul>
      <li>Strapi uses role-based permissions for API access</li>
      <li>By default, the Public role has limited access</li>
      <li>You may need to create a dedicated role with proper permissions</li>
      <li>Ensure the API Token is associated with a role that has read permissions</li>
    </ul>
  </Accordion>

  <Accordion title="Custom content types">
    <ul>
      <li>The integration works with any Strapi content type</li>
      <li>Custom fields and components are supported</li>
      <li>Ensure your content types have API enabled in their settings</li>
      <li>Check that the content schema is properly configured</li>
    </ul>
  </Accordion>
</AccordionGroup>

<Info>
  **Security**: We use Strapi API Tokens for authentication. These tokens can be revoked or regenerated at any time from your Strapi admin without affecting your application.
</Info>

<Warning>
  **Important**: Save your API Token securely when you create it. Strapi only shows it once and you'll need to regenerate it if lost.
</Warning>

<Tip>
  **Best Practice**: Create a dedicated role in Strapi for the BubblaV integration with specific permissions rather than using full admin access. This follows the principle of least privilege.
</Tip>
