# Quick start

Put the connect modal on a page in a few minutes.

Pick your framework, your project and a backend. Then copy the prompt into your agent, or write the files yourself. Both do the same thing.

If you don't have a backend yet, pick Simulation. It answers with made-up DNS, so you can see the whole flow before you write one. Don't ship it.

## Pick your setup

### Copy the prompt into your agent

Prompt

```
Set up @prufy/connect in this React project with Next.js. It's a web component, <prufy-connect>, that walks someone through proving they own a domain, inside this app. If the folder is empty, create the project first: npx --yes create-next-app@latest . --yes

1. Install @prufy/connect with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
2. Add a note to AGENTS.md, creating it if needed: before using @prufy/connect, read https://www.prufy.dev/docs/components.md and the pages it links to. Every page of Prufy's docs has a Markdown copy at its address plus .md, and https://www.prufy.dev/llms.txt lists them all.
3. Render <PrufyConnect appName="…" endpoint="/api/connect" /> from @prufy/connect/react where people add a domain. It renders on the server as it is, in a server component or a client one.
4. Add app/api/connect/[action]/route.ts that exports createConnectHandler(createFixtureClient({ provider: "cloudflare", firstCheck: "wrong_host" })) as GET and POST, with createConnectHandler from @prufy/connect/server and createFixtureClient from @prufy/connect/simulation. Its DNS answers are made up, so it must not ship.
5. Listen for the verified event (onVerified) and save the domain. Treat it as a hint and confirm on the server before relying on it.
6. Run the app and go through the modal once. The simulation's first DNS check needs a fix, so that path shows too.
```

### Or write it yourself

The same choices, as the files the agent would write.

Terminal

```shell
npm install @prufy/connect
```

app/api/connect/[action]/route.ts

```javascript
import { createConnectHandler } from "@prufy/connect/server"
import { createFixtureClient } from "@prufy/connect/simulation"

// Made-up DNS answers, to try the flow. Don't ship this.
const handler = createConnectHandler(createFixtureClient({ provider: "cloudflare", firstCheck: "wrong_host" }))

export { handler as GET, handler as POST }
```

app/domains/page.tsx

```javascript
import { PrufyConnect } from "@prufy/connect/react"

// A server component. The button is drawn on the server, before any JavaScript.
export default function Domains() {
  return <PrufyConnect appName="Acme" endpoint="/api/connect" />
}
```

## Try it

Open your page. You should see a button labeled Connect your domain. Press it and type any domain.

On the simulation, the modal says the DNS is at Cloudflare and shows the record to add, in Cloudflare's own words. Press I've added it, check now. The first check finds a mistake on purpose and shows its fix. Check again, and the modal says the domain is verified and fires `verified`.

You can also tab to the button and press Enter. Focus stays in the modal while it's open, and Escape closes it.

## Keep going

- [Connect modal](https://www.prufy.dev/docs/components/connect-modal.md) covers its attributes, events, theming, parts and slots.
- [Give it a backend](https://www.prufy.dev/docs/components/connect-modal.md) replaces the simulation with calls to Prufy.
- [Make it yours](https://www.prufy.dev/docs/components/connect-modal.md) shows the modal in eight example themes, with the code for each.
- [Installation](https://www.prufy.dev/docs/components/installation.md) covers the CDN file, server rendering and Content Security Policy.
- [Guided setup](https://www.prufy.dev/docs/components/guide.md) is an experimental window that says where to click at the DNS provider.

Every page has a Markdown copy at its address plus `.md`, for your agent. The whole set is in [llms.txt](https://www.prufy.dev/llms.txt), and `@prufy/connect`'s README ships with the package.

---

Every page of these docs, as a list: https://www.prufy.dev/llms.txt
