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

# Quickstart

> Get started with AppSloth in your application in minutes

## Installing AppSloth

Add AppSloth to your application using your preferred package manager.

<CodeGroup>
  ```bash npm theme={null}
  npm install appsloth
  ```

  ```bash yarn theme={null}
  yarn add appsloth
  ```

  ```bash pnpm theme={null}
  pnpm add appsloth
  ```

  ```bash bun theme={null}
  bun add appsloth
  ```
</CodeGroup>

## Environment Setup

Add your AppSloth Client ID to your environment variables. After creating a project, you can find your Client ID on the home page of your [AppSloth Dashboard](https://dashboard.appsloth.com).

<CodeGroup>
  ```bash .env.local (Next.js) theme={null}
  NEXT_PUBLIC_APPSLOTH_CLIENT_ID=your_client_id_here
  ```
</CodeGroup>

## Adding the Provider

Add the AppSloth Provider at the root of your application to enable AppSloth functionality throughout your app.

<CodeGroup>
  ```jsx Next.js App Router {2,8-13,15} theme={null}
  // app/layout.js or app/layout.tsx
  import { AppSlothProvider } from 'appsloth/provider';

  export default function RootLayout({ children }) {
    return (
      <html lang="en">
        <body>
          <AppSlothProvider 
            userEmail="user@example.com" // User's email for identification
            customerId="project-123" // For business apps: project/workspace ID
            // OR
            // customerId="user-456" // For consumer apps: user ID
          >
            {children}
          </AppSlothProvider>
        </body>
      </html>
    );
  }
  ```

  ```jsx Next.js Pages Router {2,6-11,13} theme={null}
  // pages/_app.js or pages/_app.tsx
  import { AppSlothProvider } from "appsloth/provider";

  function MyApp({ Component, pageProps }) {
    return (
      <AppSlothProvider
        userEmail="user@example.com" // User's email for identification
        customerId="project-123" // For business apps: project/workspace ID
        // OR
        // customerId="user-456" // For consumer apps: user ID
      >
        <Component {...pageProps} />
      </AppSlothProvider>
    );
  }

  export default MyApp;
  ```

  ```jsx React {2,6-11,13} theme={null}
  // src/App.jsx or src/App.tsx
  import { AppSlothProvider } from "appsloth/provider";

  function App() {
    return (
      <AppSlothProvider
        userEmail="user@example.com" // User's email for identification
        customerId="project-123" // For business apps: project/workspace ID
        // OR
        // customerId="user-456" // For consumer apps: user ID
      >
        <YourApp />
      </AppSlothProvider>
    );
  }

  export default App;
  ```
</CodeGroup>

<Note>
  For business applications, use a project or workspace ID as the `customerId`.
  For consumer applications, use the individual user's ID.
</Note>

## Next Steps

Now that you've set up AppSloth in your application, add some components into your app:

<CardGroup cols={2}>
  <Card title="Banners" icon="flag" href="/features/banners">
    Create eye-catching banners to highlight important announcements
  </Card>

  <Card title="Feedback" icon="comments" href="/features/feedback">
    Collect and manage user feedback to improve your product
  </Card>

  <Card title="Inbox" icon="inbox" href="/features/inbox">
    Send targeted in-app messages and alerts to your users
  </Card>

  <Card title="Retention" icon="chart-line" href="/features/retention">
    Collect feedback and present salvage offers when users try to cancel
  </Card>
</CardGroup>
