prufy
Skip to the page

ComponentsGuided setup

Components

Guided setup

For someone who has never touched DNS. They share the tab with their DNS provider, and a small window says where to click, one step at a time, until DNS shows the record.

On this page

Where this standsExperimental

The guide is a second element, prufy-guide, in its own entry, @prufy/connect/guide, so a page with only the modal never carries it. The connect modal offers it after the manual steps as Guide me through it, opens Prufy's guide page in its own window, and checks DNS itself when the page says it's done.

PieceWhere it isHow settled
prufy-guide@prufy/connect/guideExperimental
PrufyGuide, useGuide@prufy/connect/guide/reactExperimental
createGuideHandler@prufy/connect/serverExperimental
createAiGuide@prufy/connect/guide/aiExperimental
Screenshot hintsvisual-hintsExperimental
createFixtureGuide, createSimulatedScreen@prufy/connect/simulationDemo only

What it can do

  • Watch the tab the person shares. One screenshot a turn, scaled to 1280 pixels wide, and only after they say they're signed in. The first thing it shows is what it will see and that an AI reads it.

  • Say where to click, in the provider's own words. One short step at a time, using the labels on the screen: Add record, Name, Save.

  • Hand over the values with copy buttons. A step can point at the name or the value. The button copies it from the record, in the form the provider's field wants.

  • Wait for the person. Progression is manual by default: Next, a confirmation like Name pasted, or Not sure, which opens a question field. It can follow the tab on its own instead, with auto-advance.

  • Check DNS for real. When the record should be there, it runs Prufy's DNS check, the same one as everywhere else, and shows the same checking and verified animation as the modal.

  • Float above the provider's tab. In Chrome and Edge it opens in a Picture-in-Picture window that stays on top. Elsewhere, or with dock, it docks beside the page.

  • Wear your theme. It takes the same tokens as the modal, as CSS custom properties or a theme object.

What it can't do

  • It can't click, type or change anything. It only looks and talks. The person does every step.

  • It never writes a value. The model can name a field to copy. It can't put the record's host or value in its own words, so it can't get them wrong.

  • It can't say verified. The model can ask for a DNS check. Only the check's answer moves the guide to verified, and only that fires verified.

  • It can't send links or markup. Its words are plain text. The only link is the provider's settings page, from the record.

  • It doesn't run in your page. The guide runs on Prufy's origin, so the browser names Prufy as the site sharing the screen, and the screenshots never pass through your server.

  • It can't run on a phone. Sharing a tab needs getDisplayMedia. The modal only offers the guide where the browser can share one.

  • It doesn't run forever. A session ends after 120 screenshots or 15 minutes, by default.

  • It keeps sessions in one server's memory. createAiGuide holds each session in the process that started it, so every request of a session has to reach the same server.

Make it yours

The guide below is the real element, docked inside the stage and running on the package's simulation: nothing is shared and nothing is sent. Pick a theme, switch between light and dark, or edit the accent, corners and font. The code under it is exactly what the preview is wearing.

Simulated

Example themes

Styled after well-known brands. Not made or endorsed by them.

Default, dark: No theme at all. The tokens' own fallbacks.

import { PrufyGuide } from "@prufy/connect/guide/react"

<PrufyGuide
  endpoint="/api/guide"
  domain="acme.com"
  theme={{
    mode: "dark",
  }}
/>

The tokens are the modal's: --prufy-accent, --prufy-radius, --prufy-font and the rest. The full list, with what each one falls back to, is on the connect modal's page. A theme set on the element follows it into the floating window.

Use it

The guide page lives on Prufy's origin. It needs the element, the domain, and the handler's address. Pass the ticket from the modal's detection, so the guide shows the same record.

The guide page, from a CDN
<script type="module" src="https://unpkg.com/@prufy/connect@0.1/cdn/prufy-guide.js"></script>

<prufy-guide endpoint="/api/guide" domain="acme.com"></prufy-guide>

The CDN file, https://unpkg.com/@prufy/connect@0.1/cdn/prufy-guide.js, carries Lit and everything else it needs. With a bundler, import "@prufy/connect/guide" registers the element instead.

In React
import { PrufyGuide } from "@prufy/connect/guide/react"

export function GuidePage({ domain, ticket }: { domain: string; ticket?: string }) {
  return (
    <PrufyGuide
      endpoint="/api/guide"
      domain={domain}
      ticket={ticket}
      onVerified={({ domain }) => markVerified(domain)}
    />
  )
}

The handler answers three requests. The last part of the path picks one, so it works wherever you mount it.

Its handler
// app/api/guide/[action]/route.ts, on Prufy's own origin
import { createGuideHandler } from "@prufy/connect/server"
import { createAiGuide } from "@prufy/connect/guide/ai" // experimental
import { source } from "@/lib/guide-source" // looks the domain up, runs the DNS check

const handler = createGuideHandler(createAiGuide({ source }))
export { handler as POST }
RequestWhat it does
POST…/startOpens a session: the provider, the record and the caps.
POST…/turnThe newest screenshot or a reply in, steps out, streamed one JSON line each.
POST…/checkPrufy's real DNS check, without the model.

Host it in your app

The guide shares a screen, opens a window of its own and calls a model, so the page around it has more to get right than a page around the modal. Each of these cost a real integration time to find.

On the page

  • Mount it where re-renders can't remove it. Taking the element out of the page stops the share and ends the session. If the part of your page around it swaps on polling or a state change, mount PrufyGuide above it.

  • Open it from the click. The floating window and the share prompt need the click that asked for them. Call show() in the click handler, or put your button in the trigger slot. Opened from an effect, after an await, or by setting open from state, the guide docks instead, without saying why.

  • Allow screen sharing. A Permissions-Policy that leaves out display-capture makes the share fail with no hint that a header is why. Allow it on the page that hosts the guide:

Response header
Permissions-Policy: display-capture=(self)
  • Hide it where a tab can't be shared. Phones can't share one. browserScreen().supported, from @prufy/connect/guide, says so. It reads navigator, so in React read it in a way that renders the same on the server:

use-can-share-screen.ts
import { browserScreen } from "@prufy/connect/guide"
import { useSyncExternalStore } from "react"

const subscribe = () => () => {}

/** True where a tab can be shared, false where it can't, null on the server. */
export const useCanShareScreen = () =>
  useSyncExternalStore(subscribe, () => browserScreen().supported, () => null)
  • Treat verified as a hint. verified fires after Prufy's DNS check, from the element's own state. On it, re-read your server's state. Never mark a domain verified because the event fired.

Content Security Policy

  • Server-rendered, it writes a style tag. PrufyGuide renders its trigger on a server with a <style> inside. Allow it by a hash computed from guideShadowHtml(), plus one for a theme, or mount the element only in the browser, where it adopts its styles and there's nothing to allow.

  • The floating window keeps your policy. The Picture-in-Picture window inherits the page's CSP. In 0.1.0, the panel's styles and copied fonts are plain <style> tags there, so a policy that allows styles only by nonce or hash blocks them and the panel floats unstyled. Only a production CSP shows it. Set dock until the next release, which carries the page's nonce into the window.

  • Screenshot hints need data: images. With visual-hints, the screenshot is shown as a data:image/jpeg URL, so the page's policy needs img-src data:. Without it the image is blocked and the step shows only its text. In 0.1.0 the only sign is a CSP report in the floating window's console. From the next release the panel says the screenshot couldn't be shown, and previewchange reports blocked.

On the server

  • Install ai. It's an optional peer, needed only for @prufy/connect/guide/ai.

  • Give it AI Gateway credentials. AI_GATEWAY_API_KEY, or the project's OIDC token on Vercel. Zero data retention is on by default and needs a paid AI Gateway plan or credits. Without one, turns fail.

  • Allow big, slow turns. A turn's body carries one screenshot, up to 3 MB, and its answer streams. Give the route a longer time limit than a JSON route: Prufy uses 60 seconds.

  • Check who's asking before a session starts. source.start sees only the domain and ticket the page sent, and anyone can send any. Check that the signed-in user owns the domain in your route, before the handler. Later turns carry a random session id.

  • Share sessions across instances. By default createAiGuide keeps sessions in its own memory, so on serverless a turn can reach an instance that never saw the session. In 0.1.0, keep a session on one instance. From the next release, pass a shared store.

  • Answer errors in the guide's shape. Anything your route refuses before the handler should answer { error: { kind, message } }, where kind is domain, rate_limited, unreachable or server. Anything else reads as server.

The route, put together
// app/api/guide/[action]/route.ts
import { createAiGuide } from "@prufy/connect/guide/ai"
import { createGuideHandler } from "@prufy/connect/server"

// Once per process: sessions live in this object's memory.
const handler = createGuideHandler(createAiGuide({ source }))

export const maxDuration = 60 // a turn streams the model's answer

export async function POST(request: Request) {
  // domain and ticket come from the page, so anyone can send any. Check them
  // before the handler starts a session. Later turns carry a random session id.
  if (new URL(request.url).pathname.endsWith("/start")) {
    const { domain } = await request.clone().json()
    if (!(await ownsDomain(request, domain))) {
      return Response.json(
        { error: { kind: "domain", message: "We can't find that domain." } },
        { status: 404 },
      )
    }
  }
  return handler(request)
}

Testing it

Most automated and embedded browsers can't float a window or share a tab: they offer both, then fail, so the guide docks and the share reads as cancelled. Test in Chrome. Headless Chrome can answer the share prompt itself, and the floating window shows up as a second about:blank page:

Terminal
# Chrome answers the share prompt itself, by the tab's title.
chrome --headless=new \
  --auto-select-tab-capture-source-by-title="Namecheap" \
  --remote-debugging-port=9222

New in the next release

These came out of that integration and are in the package's source, not in 0.1.0 on npm yet.

  • Open it from your own button. PrufyGuide takes a ref to the element, for show(), close() and reset(), and noTrigger (no-trigger in HTML) draws no button of its own:

Your own button
import { PrufyGuide, type PrufyGuideElement } from "@prufy/connect/guide/react"
import { useRef } from "react"

export function Walkthrough({ domain }: { domain: string }) {
  const guide = useRef<PrufyGuideElement>(null)
  return (
    <>
      {/* show() runs inside the click, so the guide can float. */}
      <button type="button" onClick={() => guide.current?.show()}>
        Start walkthrough
      </button>
      <PrufyGuide ref={guide} noTrigger endpoint="/api/guide" domain={domain} />
    </>
  )
}
  • Tell someone to wait. When your own check is cooling down or already running, waitingOutcome is the answer for source.check:

A check that has to wait
import { waitingOutcome } from "@prufy/connect/server"

const source = {
  start,
  check: async (session) =>
    (await onCooldown(session))
      ? waitingOutcome({
          label: "Waiting on Prufy",
          headline: "We checked a moment ago",
          why: "Give it 10 seconds, then check again.",
        })
      : runTheCheck(session),
}
  • An ended session says why. When your backend ends a session with a rate_limited error, the panel shows your message. Before, it always said the session ran out of screenshots.

  • The simulation's sessions don't collide. createFixtureGuide gives every session a unique id, across instances. Its checks are still scripted, so it stays for demos and tests.

Configure it

Every attribute is also a property, in camelCase. The ones you're most likely to set:

Attributes
<prufy-guide
  endpoint="/api/guide"
  domain="acme.com"
  auto-advance
  dock
></prufy-guide>
  • auto-advance follows the shared tab: when it changes and settles, the guide looks again. Left out, each step waits for a reply. The options menu can switch it too, and fires progressionchange so your own control can follow.

  • dock never floats. Use it when the page has room beside it, or for a preview.

  • contained docks inside the nearest positioned ancestor instead of the window, the way the gallery above does.

  • ticket is the record's token from the modal, so both show the same record. Left out, the backend issues a new one.

The full list is in the reference.

The model loopExperimental

createAiGuide, from @prufy/connect/guide/ai, is the guide's backend on the AI SDK. It runs on a server only: no browser entry imports it, so ai never reaches a page. It needs a Vercel AI Gateway model and ai 7 or newer.

The model has two tools. show_step draws a step, and its schema can't carry a record value, a link or a delete. check_dns runs source.check, Prufy's real check. A turn ends as soon as a step is shown.

OptionTypeLeft out, it isWhat it does
sourceGuideSourceRequiredWhere sessions come from. start looks the domain up and phrases the record; check runs Prufy's real DNS check.
modelLanguageModel | string"google/gemini-3.8-flash"A model, or an AI Gateway model string.
fallbackModelsstring[]"anthropic/claude-haiku-5.5", "openai/gpt-5.6-luna"Tried in order when the model can't answer.
zeroDataRetentionbooleantrueRoutes only to providers that keep nothing, because frames show someone's DNS account. Needs a paid AI Gateway plan or credits.
limits{ frames, minutes }120 frames, 15 minutesWhat one session may use before it ends.
now() => numberDate.nowA clock, for the time limit.
storeExperimentalGuideSessionStoreThis process's memoryWhere sessions live between requests. Pass a shared store on a host with several instances, such as serverless. From the release after 0.1.0.
onServedExperimental(served) => voidNoneCalled once a turn with the model that actually answered, which can be a fallback. For logs; nothing from the screen is in it.
trustTargetsExperimental(served) => booleantrustsGeminiTargetsWhether to keep a screenshot box from the model that answered. A dropped box keeps its written step.
onTurnExperimental(report) => voidNoneCalled once a turn, when it ends or fails: the model that answered, whether a screenshot went with it, what became of its box, how long it took. For logs; nothing from the screen or the conversation is in it. From the release after 0.1.0.
thinkingExperimental"low" | "medium" | "high"The model's ownHow much the model reasons before it answers, where it supports the setting (Gemini 3 and later). Lower is faster. From the release after 0.1.0.

Screenshot hintsExperimental

Off by default. With visual-hints, a step can come with a close-up of the control it means, cut from the screenshot already taken for that turn. Show full tab zooms back out. The picture stays in the guide's window: it never goes into the conversation, an event or your server.

Turning it on
<!-- Experimental: off by default -->
<prufy-guide endpoint="/api/guide" domain="acme.com" visual-hints></prufy-guide>
  • Only from a model the handler trusts. The model returns Gemini's native box_2d, and the server converts it. The default trustTargets keeps boxes from Gemini only. If AI Gateway falls back to another model, its box is dropped and its written step kept.

  • Checked on made-up screens only. Gemini 3.8 Flash placed 8 of 8 boxes on synthetic provider forms. Real provider pages haven't been tried.

  • Unsure means no picture. A missing or malformed box leaves the written step on its own.

  • Allow data: images. Add data: to img-src on the page that hosts the guide. See Content Security Policy.

Without the element

To draw the guide with your own components, use the same flow without its markup. useGuide runs the machine, the controller and the safety rules, and gives you the derived view. createGuideController, from @prufy/connect/guide, does the same outside React.

Your own markup
import { createGuideHttpClient } from "@prufy/connect/guide"
import { useGuide } from "@prufy/connect/guide/react"

const client = createGuideHttpClient({ endpoint: "/api/guide" })

export function MyGuide() {
  const { view, controller } = useGuide(client, { target: { domain: "acme.com" } })
  // view: the status, the current stage and its replies. Draw them your way.
  // controller: open(), share() from a click, signedIn(), say(text), check(), close().
  return <YourPanel view={view} onShare={() => controller.share()} />
}

A floating window and a screen share can only start from a click, so call controller.open() and controller.share() from one.

Reference

prufy-guide

From @prufy/connect/guide. client and screen are properties only: a backend object in place of endpoint, and a screen to share in place of the browser's, for demos.

AttributeTypeWhat it does
visual-hintsExperimentalbooleanOpt into a local screenshot preview when the current step has a valid target. Off by default; only the current captured frame is shown.
auto-advancebooleanFollow changes in the shared tab automatically. Left out, each step waits for Next or I did it.
endpointURLWhere the guide's handler is mounted.
domaintextThe domain being proved.
tickettextThe record's token from the modal, so the guide shows the same record. Left out, a new one is issued.
labeltextThe trigger's words. Guide me through it by default.
no-triggerbooleanDraws no trigger. Open the guide from your own button with show(). From the release after 0.1.0.
openbooleanWhether the guide is open. The element keeps it current.
dockbooleanNever float: always dock beside the page, even where a floating window could open.
containedbooleanDocks inside the nearest positioned ancestor, not the window. For previews.
modelight | darkPicks the default colours. Left out, the element follows the page's color-scheme.
themeJSONThe theme as an object. The same tokens as the modal.
EventDetailWhen
progressionchange{ autoAdvance }Automatic progression changed. Keep the host's progression control in sync.
verified{ domain, provider, method: "guided" }Prufy's DNS check found the record. Never sent on the model's word.
openchange{ open }The guide opened or closed.
phasechange{ phase, state }The guide moved on: consent, sharing, signing in, watching, verified.
declined{}The person chose the steps instead. Show yours.
copied{ field, value }Someone copied the name or the value.
previewchange{ step, status }What became of a step's screenshot: highlighted, shown, blocked (the page's img-src doesn't allow data:), no_screen, not_pictured or off. For your logs. Experimental, with screenshot hints. From the release after 0.1.0.
MethodWhat it does
show()Opens the guide. Call it from a click, so it can float.
close()Closes it and stops sharing. The conversation stays.
reset()Starts over with a new session.
PartWhat it is
triggerThe button that opens the guide.
panelThe guide's box, floating or docked.
headerThe title, domain and options button.
titleThe guide's heading.
heroThe shared provider bridge for checking DNS and verified ownership.
statusThe visible footer badge naming what the guide is doing.
optionsThe ellipsis button for the guide's secondary controls.
closeClose the guide, in its options menu.
recordThe full DNS record, shown on request from the options menu.
copy-buttonA copy button, inside its instruction or the record sheet.
stepOne step from the guide.
previewExperimentalThe current step's transient screenshot preview.
preview-targetExperimentalThe outline around the suggested control in the screenshot.
preview-toggleExperimentalSwitches between the focused target and the full shared tab.
latestThe button back to the newest step.
repliesThe row of quick replies.
replyOne quick reply.
inputThe question field, revealed by Not sure.
buttonEvery button on a card.
primaryThe main button of a card. It is also a button.
quietThe secondary buttons. Each is also a button.
SlotWhat goes in it
triggerYour own button, in place of ours.

What isn't here yet

  • A hosted guide page. Prufy doesn't serve one yet, so the modal's …/guide has nothing to point at in production.

  • Screenshot hints on real pages. They were checked on made-up screens only.

  • Safari and Firefox. It has only been checked in Chrome.

  • Other languages. The guide's own words are English.