"use client"; import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { docsUrl } from "@/lib/docs"; import { HelpTip } from "./help-tip"; const IDENTITY_MODES = [ { value: "did_web", title: "Use your domain", description: "Your domain name becomes your identity. This is the simplest option, since HappyView will generate everything automatically.", helpTip: "Uses your domain as a did:web identifier. Your server hosts a DID document at /.well-known/did.json. The identity is tied to your domain.", badge: "Recommended", }, { value: "attach_account", title: "Use an existing AT Protocol account", description: "Link this AppView to an account you already own. You'll verify ownership through that account.", helpTip: "Links your AppView to an existing account's DID. Authentication goes through that account's Personal Data Server.", badge: null, }, { value: "did_plc", title: "Create a new network identity", description: ( <> Register a new identity in the AT Protocol directory. This is the most durable option because a did:plc will survive domain changes. ), helpTip: "Registers a did:plc identity in the AT Protocol directory. Supports key rotation and recovery, and isn't tied to any single domain.", badge: null, }, ]; interface SetupIdentityModeProps { onComplete: (mode: string) => void | Promise; } export function SetupIdentityMode({ onComplete }: SetupIdentityModeProps) { const [selected, setSelected] = useState(null); const [submitting, setSubmitting] = useState(false); return ( Set up your service identity AT Protocol apps typically verify requests through a user's data server before they reach your AppView. To accept those requests, your AppView needs its own identity on the network.

This is optional. HappyView includes its own auth, but a service identity is recommended for compatibility with standard AT Protocol apps.
Learn more
{IDENTITY_MODES.map((mode) => ( ))}
); }