Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

domain.onCreated

A domain was registered with the provider — show your user its DNS records.

Fires when a domain is registered with the provider via emailkit.domains.create(). The event’s domain.verification.records are the DNS records your user needs to add — save the domain and show them.

hooks: {
  domain: {
    onCreated: async ({ emailDriver, domain }) => {
      await prisma.sendingDomain.create({
        data: {
          emailDriver,
          domain: domain.domain,
          status: domain.status,
          records: domain.verification?.records,
        },
      });
    },
  },
},

The full setup flow is covered in Manage domains.

Payload

PropType
emailDriverstring
Typestring
domainDomain
TypeDomain
context?unknown
Typeunknown

Last updated on July 24, 2026

Was this page helpful?