Skip to main content
Hosted checkout is the fastest way to offer domain search, purchase, and management inside your product. You add one backend endpoint that creates a session, and one iframe on the frontend that loads Dotlet’s hosted UI. Dotlet builds, hosts, and updates the actual search/purchase/DNS screens and you don’t have to build any of that UI yourself. Choose this path if you want customers managing domains as soon as possible, and don’t need to control the exact look and feel of every screen beyond basic theming (logo, brand name, primary color).
Prefer to own the UI pixel-for-pixel, or build a flow that doesn’t look like an iframe at all? See Direct integration instead.

How it works

  1. Your frontend asks your own backend to start a domain session (never call Dotlet directly from the browser, that would expose your API key).
  2. Your backend calls POST /api/v1/hosted/sessions with your Dotlet API key and gets back an embed_url.
  3. Your frontend renders that embed_url in an iframe.
  4. The iframe posts window.postMessage events back to your page as the customer moves through the flow, so you know when to resize, close, or show a success state.
A full reference implementation (Next.js) is available at nethersync/dotlet-widget-demo. See the code snippets below.

Step 1: Create a backend endpoint

Add one route to your backend that calls Dotlet’s session endpoint. Your Dotlet API key stays server-side and is never sent to the browser.
This example is Next.js, matching the reference repo. The pattern is the same in any backend, one server-side route that calls POST /api/v1/hosted/sessions with your API key and forwards the JSON response to your frontend.
external_user_id and external_account_id are optional but recommended, they let you correlate anything the customer does in the session (a purchase, a DNS change) back to your own user and account records. allowed_actions scopes what the session can do; see the table below. The response looks like:

Step 2: Embed the iframe on your frontend

Call your backend route, then render the returned embed_url in an iframe.

Step 3: Listen for events from the iframe

The hosted UI communicates back to your page with window.postMessage. Listen for these events to resize the iframe, close it, or show your own success state:

Theming

theme_config on the session request controls how the hosted UI is branded: All three fields are optional. You can also pass a metadata object (any JSON) on the session request if you want to attach your own data to the session; it isn’t used by Dotlet, only stored against the session.

Session expiry

Sessions expire after expires_in_minutes (5–1440, default 60). Create a new session each time a customer opens the checkout flow rather than reusing one across visits.

Next steps

Direct integration

Build your own UI on top of the raw domain and DNS endpoints instead.

Hosted Sessions API reference

Full request and response schema for the session endpoint.