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

# Installation

> Now that you already have an account and a project on Logaflow, it's time to install the widget to start receiving feedback from your users.

## HTML installation

General installation, the Logaflow widget is a web component that you can install in your project/product using HTML + javascript code. You can add this code to any page where you want to use the widget, see example below:

```html theme={null}
<!DOCTYPE html>
<html lang="en">
  <head>
    ...
    <!-- Logaflow widget script -->
    <script
      type="module"
      crossorigin="true"
      async
      src="https://widget.logaflow.com/addons/logaflow-widget.umd.js?version=1.0.0"
    ></script>
  </head>

  <body>
    <!-- Add Logaflow widget web component to the top of your -->
    <logaflow-widget
      project-key="YOUR_LOGAFLOW_PROJECT_TOKEN_HERE"
      trigger-text="Feedback"
    ></logaflow-widget>

    ...
  </body>
</html>
```

<Note>
  You must replace **YOUR\_LOGAFLOW\_PROJECT\_TOKEN\_HERE** with your project token.
  You can find and copy your token on the [project settings
  page](https://app.logaflow.com/workspace/settings).
</Note>

<Tip>
  The **trigger-text** property is the text that appears on the button that
  opens the feedback popup for the user, you can change it to the text you
  prefer.
</Tip>

## React installation

<Steps>
  <Step title="Install Logaflow package">
    ```shell theme={null}
    npm i @logaflow/react
    ```

    or using yarn

    ```shell theme={null}
    yarn add  @logaflow/react
    ```
  </Step>

  <Step title="Import Logaflow's widget in your application">
    ```tsx theme={null}
    import React from 'react'
    import ReactDOM from 'react-dom/client'

    import { LogaflowWidget } from '@logaflow/react'
    import '@/styles/globals.css'

    import AppRoot from './app.root.tsx'

    ReactDOM.createRoot(document.getElementById('root')!).render(
      <React.StrictMode>
        <>
          {/* Add the logaflow widget to the top of your react project */}
          <LogaflowWidget projectKey={YOUR_PROJECT_TOKEN} />
          <AppRoot />
        </>
      </React.StrictMode>
    )
    ```

    <Info>
      You can change the import location if you prefer
    </Info>
  </Step>

  <Step title="All ready!">
    The logaflow feedback widget will now appear in your project
  </Step>
</Steps>

## Next 14 installation

<Steps>
  <Step title="Install Logaflow package">
    ```shell theme={null}
    npm i @logaflow/next
    ```

    or using yarn

    ```shell theme={null}
    yarn add  @logaflow/next
    ```
  </Step>

  <Step title="Import Logaflow's widget in your application">
    ```tsx theme={null}
    // app/layout.tsx

    import type { Metadata } from "next";
    import { Inter } from "next/font/google";
    import { LogaflowWidget } from "@logaflow/next"
    import "./globals.css";

    const inter = Inter({ subsets: ["latin"] });

    export const metadata: Metadata = {
      title: "Create Next App",
      description: "Generated by create next app",
    };

    export default function RootLayout({
      children,
    }: Readonly<{
      children: React.ReactNode;
    }>) {
      return (
        <html lang="en">
          <body className={inter.className}>
            {/* adding logaflow in the scope of where you want it to appear on the top of your project */}
            <LogaflowWidget projectKey="PROJECT_TOKEN" />
            {children}
          </body>
        </html>
      );
    }
    ```

    <Info>
      You can change the import location if you prefer
    </Info>
  </Step>

  <Step title="All ready!">
    The logaflow feedback widget will now appear in your project
  </Step>
</Steps>
