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

# Setup

> How to setup Superflow with React.js

[Github Repo](https://github.com/benjvelt/superflow-react)

[Demo](https://superflow-react.vercel.app/?review=true)

## 1) Enter Your Site URL

Enter the site URL you want Superflow to be installed in.

<Frame>
  <img src="https://mintcdn.com/superflow/gnnXgtB9B2DXpreO/images/enter-url-final.png?fit=max&auto=format&n=gnnXgtB9B2DXpreO&q=85&s=70fcaae4e19e53003e35d892eff89874" alt="" width="3736" height="1797" data-path="images/enter-url-final.png" />
</Frame>

## 2) Select NPM from the list of Platforms

Choose NPM from the list of options to install Superflow with React.js.

<Frame>
  <img src="https://mintcdn.com/superflow/hdb1NqEMmtSslllh/images/select-npm-final.png?fit=max&auto=format&n=hdb1NqEMmtSslllh&q=85&s=1fb6f487ada70ee76148105d2132882d" alt="" width="1688" height="952" data-path="images/select-npm-final.png" />
</Frame>

## 3) Copy your unique Superflow Code

Copy the code from the section "Initialize Superflow"

<Frame>
  <img src="https://mintcdn.com/superflow/XWbQ_WnDAi9pqsmS/images/copy-npm-final.png?fit=max&auto=format&n=XWbQ_WnDAi9pqsmS&q=85&s=fd0f1dc8ce132da0e4c1f88926c46bd5" alt="" width="644" height="323" data-path="images/copy-npm-final.png" />
</Frame>

## 4) Install the Superflow NPM package

Install the Superflow NPM package with:

```
npm i @usesuperflow/client
```

## 5) Import Superflow into your `App.js` file

Import the Superflow NPM package with:

```
import { initSuperflow } from '@usesuperflow/client'
```

## 6) Initialize Superflow within `App.js`

Import `initSuperflow` from the NPM package and use it to initialize Superflow.

Create a `useEffect` hook and paste in the unique Superflow code you copied earlier.

```js theme={null}
import './App.css';
import logo from './logo.svg';

import { initSuperflow } from '@usesuperflow/client';
import { useEffect } from 'react';


function App() {

  useEffect( () => {
    //initialize Superflow
    initSuperflow('YOUR_API_KEY', {
      projectId: 'YOUR_PROJECT_ID'
    });
  })
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
          <p>Test out Superflow by highlighting this text.</p>
      </header>
    </div>
  );
}

export default App;


```

## 7) Deploy your React app with your changes.

Deploy your React app with your new changes.

## 8) Verify your Installation

Verify your Superflow installation by clicking the Verify button on the onboarding flow.

<Frame>
  <img src="https://mintcdn.com/superflow/hdb1NqEMmtSslllh/images/verify-final.png?fit=max&auto=format&n=hdb1NqEMmtSslllh&q=85&s=890ba1333755e4d746505cc619a2c03a" alt="" width="2998" height="1459" data-path="images/verify-final.png" />
</Frame>

If successful, you should be redirected to your published React site and see the following success message:

<Frame>
  <img src="https://mintcdn.com/superflow/hdb1NqEMmtSslllh/images/verified-final.png?fit=max&auto=format&n=hdb1NqEMmtSslllh&q=85&s=6e1b9b3a5fd451707b5fb936573ef56a" alt="" width="1366" height="1206" data-path="images/verified-final.png" />
</Frame>

## 9) Troubleshooting

Having trouble getting your verifying your installation? Here are the common mistakes users encounter when installing Superflow:

* Did you forget to save the Custom Code?
* Did you forget to publish your site?
* Is the browser still loading a cached version?
* Did you add `?review=true` at the end of your url?
* Did you publish your changes on a staging URL while you are trying to access a Prod URL?
* Did you accidentally install multiple Superflow scripts in the Custom Code?

## 10) Navigate to your React site

Now that you have verified that Superflow has been installed on your React site, navigate to your published site and add `?review=true` at the end of the URL to enable Superflow.

`Example: mywebsite.com/?review=true`

## 11) Test out Superflow

You should now see a Superflow toolbar on the bottom right of your screen.

<Frame>
  <img src="https://mintcdn.com/superflow/uK-U8b-1fpW-Yhti/images/react-toolbar-final.png?fit=max&auto=format&n=uK-U8b-1fpW-Yhti&q=85&s=6d7a9cb09fd181900ffae6e0bfd24bb2" alt="" width="1683" height="949" data-path="images/react-toolbar-final.png" />
</Frame>

## 12) Dropping your first comment

Try leaving a comment on your page.

You can leave a comment in several different ways:

* By highlighting any text
* By hovering over any element on the page
* By drawing a box anywhere on the page

You can also leave voice and screen recordings in your comments as well!

<Frame>
  <img src="https://mintcdn.com/superflow/XWbQ_WnDAi9pqsmS/images/demo.gif?s=013fcafea837a87dcad1c0d516e1ebee" alt="" width="640" height="360" data-path="images/demo.gif" />
</Frame>
