# Apps

> Comment on your running product, on its previews, QA, production or your dev server, with one script tag.

An app is a product that's already running, with its own sign-in, data and routing. Fiddle doesn't host it. Your app loads one script, and Fiddle's toolbar appears in its corner.

## Create an app

In Fiddle, go to **Apps → +** and name it. You get an app id for the toolbar.

## Add the toolbar

**Script tag**

Put this in your app's `<head>`, with the branch it was built from:

```html
<script src="https://fiddle.fyi/embed.js" data-app="<app id>" data-branch="<branch>" async></script>
```

**Vite**

```bash
npm install -D @basswood/fiddle
```

```ts
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import { fiddle } from "@basswood/fiddle/vite"

export default defineConfig({
  plugins: [react(), fiddle({ app: "<app id>" })],
})
```

The plugin adds the tag with the branch and commit. It's on for `vite dev` and Vercel and Netlify previews. For any other build, pass `enabled: true`.

**React**

```bash
npm install -D @basswood/fiddle
```

```tsx
import { FiddleToolbar } from "@basswood/fiddle/react"

<FiddleToolbar app="<app id>" branch={process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF} />
```

Render it once near the root. `useFiddle()` gives you `ready`, `isOpen`, `open`, `close` and `toggle` anywhere.

## Comment

Open a deployment. The toolbar asks you to sign in the first time, then remembers you on that site. Press **Comment** and click anything or select text. Outside comment mode, your app is untouched.

## Source tags

With the Vite plugin and `@vitejs/plugin-react`, every element is tagged with its file, line and component. Comments then say exactly what to change. Source tags are on for dev and previews and **never** in production.

## Feedback lives on branches

Comments belong to a branch, so everything said about `feature/pricing` shows wherever that branch runs. A new push doesn't start over. See [Deployments](https://docs.fiddle.fyi/deployments.md).

## Who can comment

In a team, an app is open to every member. People outside come in by invite or link, or press **Request access** in the toolbar. Being able to open your app's URL isn't enough to see its comments.

See [Toolbar API](https://docs.fiddle.fyi/toolbar-api.md) for every option.
