Developer & Embed Docs
Embed contact forms into any website, Next.js app, or Cloudflare Worker.
Available Form Types
offerpreview ↗Acquire the domain — collects bid price, phone, contact preference
partnerpreview ↗Marketing / distribution partnerships — collects company info & partnership type
staffingpreview ↗Join the team — collects team role, resume URL, developer flag
inquirepreview ↗General inquiry — collects phone & contact preference
Option 1 — Direct URL (simplest)
Link directly to a hosted form page. No setup required. Works as a full page or in an iframe.
Examples:
- /forms/offer/agentbank.com
- /forms/partner/agentbank.com
- /forms/staffing/agentbank.com
- /forms/inquire/agentbank.com
Add a button link in any HTML page:
<a href="https://www.domaindirectory.com/forms/offer/agentbank.com"
target="_blank">
Make an Offer
</a>Option 2 — iframe Embed
Drop an iframe anywhere on your page. The form handles submission internally.
<iframe
src="https://www.domaindirectory.com/forms/offer/agentbank.com"
width="100%"
height="700"
style="border:none; border-radius:16px;"
title="Make an offer for agentbank.com"
></iframe>Tip: set height to 700–900px depending on form type. The partner and staffing forms are taller.
Option 3 — JS Widget (auto-render)
Load our script and place <div data-dd-form> elements anywhere on your page. The script bootstraps the form inside each matching element. Zero framework dependencies.
Step 1 — Load the script (once per page):
<script src="https://www.domaindirectory.com/widget/dd-forms.js" defer></script>Step 2 — Place a container div:
<div
data-dd-form="offer"
data-dd-domain="agentbank.com"
></div>All attributes:
| Attribute | Required | Values |
|---|---|---|
| data-dd-form | Yes | offer | partner | staffing | inquire |
| data-dd-domain | Yes | e.g. agentbank.com |
Option 4 — Next.js / React Component
If you're in a Next.js or React app, copy src/components/ServiceContactForm.tsx from the domaindirectory-nextjs repo and import it directly.
import { ServiceContactForm } from "@/components/ServiceContactForm";
// In your page / component:
<ServiceContactForm
formType="offer"
domain="agentbank.com"
displayName="AgentBank.com"
/>The component posts to https://www.domaindirectory.com/api/domain-contact by default. Your domain must be in the CORS allow-list — contact us to add it.
Option 5 — Cloudflare Worker Injection
Inject the widget script and container into any HTML response from a Cloudflare Worker.
// worker.js
export default {
async fetch(request) {
const response = await fetch(request);
const html = await response.text();
const snippet = `
<div data-dd-form="offer" data-dd-domain="agentbank.com"></div>
<script src="https://www.domaindirectory.com/widget/dd-forms.js" defer><\/script>
`;
// Inject before </body>
const modified = html.replace("</body>", snippet + "</body>");
return new Response(modified, {
headers: { "Content-Type": "text/html" },
});
},
};API Reference
All forms POST to POST https://www.domaindirectory.com/api/domain-contact. CORS is enabled for registered portfolio domains.
| Field | Type | Required | Notes |
|---|---|---|---|
| domain | string | Yes | e.g. agentbank.com |
| string | Yes | Valid email address | |
| type | string | No | offer | partner | staffing | inquire | contact |
| name | string | No | Submitter's name |
| phone | string | No | Phone with country code |
| company | string | No | Company name |
| message | string | No | Free-text message |
| bid_price | number | No | Required when type=offer. Min $10,000 |
Example raw POST:
const res = await fetch("https://www.domaindirectory.com/api/domain-contact", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
domain: "agentbank.com",
type: "offer",
name: "Jane Smith",
email: "jane@example.com",
bid_price: 50000,
message: "I'm interested in acquiring this domain for a fintech startup.",
}),
});
const data = await res.json();
// { success: true, message: "Thank you! Your message has been received." }ALLOWED_ORIGINS in src/app/api/domain-contact/route.ts.