diff --git a/apps/web/src/components/web/hero-title-install-button.tsx b/apps/web/src/components/web/hero-title-install-button.tsx
new file mode 100644
index 00000000..36b09b9e
--- /dev/null
+++ b/apps/web/src/components/web/hero-title-install-button.tsx
@@ -0,0 +1,90 @@
+"use client";
+
+import { AnimatePresence, motion } from "framer-motion";
+import { Check, ChevronRight, Copy } from "lucide-react";
+import { useCallback, useState } from "react";
+
+import { Button } from "../ui/button";
+
+export default function HeroTitleInstallButton() {
+ const [copied, setCopied] = useState(false);
+ const [hovered, setHovered] = useState(false);
+
+ const handleCopy = useCallback(() => {
+ void navigator.clipboard.writeText("npx paykitjs init");
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1500);
+ }, []);
+
+ return (
+ setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ className="group relative gap-1.5 rounded-none border-transparent pr-3.5 h-9.5 text-xs font-medium text-neutral-600 hover:bg-transparent sm:text-sm dark:text-neutral-400 dark:text-foreground/75 dark:hover:bg-transparent"
+ >
+ {/* Diagonal lines background */}
+
+ {/* Top border */}
+
+ {/* Bottom border */}
+
+ {/* Left border */}
+
+ {/* Right border */}
+
+
+
+ {copied ? (
+
+
+
+ ) : hovered ? (
+
+
+
+ ) : (
+
+
+
+ )}
+
+
+ npx paykitjs init
+
+ );
+}
diff --git a/apps/web/src/components/web/hero-title.tsx b/apps/web/src/components/web/hero-title.tsx
index 1d9b7e5a..15d04cd9 100644
--- a/apps/web/src/components/web/hero-title.tsx
+++ b/apps/web/src/components/web/hero-title.tsx
@@ -1,21 +1,26 @@
"use client";
-import { AnimatePresence, motion } from "framer-motion";
-import { Check, ChevronRight, Copy, Sparkle } from "lucide-react";
+import { Sparkle } from "lucide-react";
import Link from "next/link";
-import { useCallback, useState } from "react";
+
+import { PROMPT } from "@/lib/consts";
import { Button } from "../ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "../ui/dialog";
+import { ScrollArea } from "../ui/scroll-area";
+import { useCopyButton } from "../ui/use-copy-button";
+import HeroTitleInstallButton from "./hero-title-install-button";
export function HeroTitle() {
- const [copied, setCopied] = useState(false);
- const [hovered, setHovered] = useState(false);
-
- const handleCopy = useCallback(() => {
- void navigator.clipboard.writeText("npx paykitjs init");
- setCopied(true);
- setTimeout(() => setCopied(false), 1500);
- }, []);
+ const [copied, handleCopy] = useCopyButton(() => navigator.clipboard.writeText(PROMPT));
return (
@@ -39,85 +44,53 @@ export function HeroTitle() {
inside your app.
-
-
}
- nativeButton={false}
- size="lg"
- className="px-4 h-9.5"
- variant="default"
- >
- Read Docs
-
-
setHovered(true)}
- onMouseLeave={() => setHovered(false)}
- className="group relative gap-1.5 rounded-none border-transparent pr-3.5 h-9.5 text-xs font-medium text-neutral-600 hover:bg-transparent sm:text-sm dark:text-neutral-400 dark:text-foreground/75 dark:hover:bg-transparent"
- >
- {/* Diagonal lines background */}
-
- {/* Top border */}
-
- {/* Bottom border */}
-
- {/* Left border */}
-
- {/* Right border */}
-
-
-
- {copied ? (
-
-
-
- ) : hovered ? (
-
-
-
- ) : (
-
-
-
- )}
-
-
- npx paykitjs init
-
+
+
+
+
}
+ nativeButton={false}
+ size="lg"
+ className="px-4 h-9.5"
+ variant="default"
+ >
+ Read Docs
+
+
+
+ }
+ >
+ or copy the prompt
+
+
+
+ Copy the prompt
+ Give this to your agent to get started.
+
+
+
+
+ {PROMPT}
+
+
+
+
+
+ {copied ? "Copied" : "Copy command"}
+
+
+
+
+
+
+
+
diff --git a/apps/web/src/lib/consts.ts b/apps/web/src/lib/consts.ts
index 8065ac03..d8f07832 100644
--- a/apps/web/src/lib/consts.ts
+++ b/apps/web/src/lib/consts.ts
@@ -73,3 +73,15 @@ export const homePageStructuredData = [
softwareApplicationSchema,
faqSchema,
];
+
+export const PROMPT = [
+ "Set up authentication in my project using Paykit (paykitjs npm package)",
+ "",
+ "1. Install paykitjs. If I already have a database configured in this project, use that - don't set up a new one.",
+ "2. Check the runtime used in the project and use the same - don't simply go with npm.",
+ "3. Create `src/lib/paykit.ts` - call createPayKit() with:",
+ " - My existing database connection by passing the url directly `database: ` (or a new pg.Pool() if none exists)",
+ " - Add payment provider based on the auth credentials in my env. Example: `bun add @paykitjs/stripe`",
+ "4. Set up the route handlers according to the current project framework.",
+ "5. Create `src/lib/paykit-client.ts` - call `createPayKitClient()` where `paykit` is the object we created when initializing Paykit in `src/lib/paykit.ts`.",
+].join("\n");