Modal.Domain reference
Domain
Section titled “Domain”Source:
packages/modal/src/Domain.ts
A custom domain for Modal web endpoints, sandbox tunnels
(customDomain on create) and model endpoints. Create the records in
dnsRecords at your DNS provider; Modal issues the certificate once they
resolve.
Domain: Adding a domain
Section titled “Domain: Adding a domain”import * as Modal from "@alchemy.run/modal";import * as Alchemy from "alchemy";import * as Effect from "effect/Effect";
export default Alchemy.Stack( "Agents", { providers: Modal.providers() }, Effect.gen(function* () { const agents = yield* Modal.Domain("Agents", { domainName: "agents.example.com" }); return { records: agents.dnsRecords, certificate: agents.certificateStatus }; }),);Domain: Serving a sandbox on it
Section titled “Domain: Serving a sandbox on it”const sandbox = yield* sandboxes.create({ encryptedPorts: [3000], customDomain: "agents.example.com",});