Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Custom domains

Put a Charming app on your own domain, and give every visitor their own private data instead of one shared pool.

What you can do

Your app, your domain. Put a Charming app at a domain you own, like apps.yourcompany.com. Custom domains are on Pro and above. A team’s app needs the team on Business.

Each visitor gets their own data. On a custom domain, every visitor gets their own private data with no sign-in needed, instead of the one shared pool a public charm.ing URL has. See Privacy and sharing.

Signed-in visitors get the same access as on charm.ing. A visitor who signs in with window.charming.login() on the domain is treated as on the App’s charm.ing page: Public, Signed-in access, and direct shares decide what they can do, and their calls use the App’s shared data with env.user set to them. On a Public App without Signed-in access, that means reading shared data and running only operations whose route declares callers. A visitor the App is not shared with keeps using it as an anonymous visitor with their own data. See Gate an action behind sign-in.

Add a domain

  1. Open the app’s settings and choose Domain.
  2. Enter the domain and choose Add domain, then confirm. Anyone who opens the domain can use the app without signing in.
  3. Add the records the page shows at your DNS provider: a TXT that proves you own the domain and a CNAME that points it at Charming. A CNAME on a subdomain like www can’t share its name with any other record, so first delete any record your provider already has on that name, such as a www record another host created. A root domain on Cloudflare is the exception: Cloudflare flattens its CNAME, so keep your other root records, such as MX. Keep the records until the domain is live.
  4. The domain goes live once the records resolve. Charming checks every minute while the page is open and every ten minutes otherwise. To check right away, choose Check now.

A root domain like example.com works with any DNS provider. If its DNS is on Cloudflare, it takes the same two records. Otherwise the app is served at www.example.com and example.com redirects there, so beside the TXT and CNAME for www, the page lists an A record for @, and a TXT named _vercel when ownership has to be proved. The A and _vercel records stay on the page after www is live, until example.com redirects. While they do, Check now checks only example.com; www is rechecked hourly.

Each app has one custom domain. To change it, remove it and add the new one. A domain keeps working if your plan ends. A domain that isn’t live within a week is removed, and you can’t add it again for 30 days. A domain that stops working is removed after 30 days.

If your domain’s CAA records would block the certificate, the page also lists the CAA records to add.

Over the API

GET, POST and DELETE on /api/v1/apps/{appId}/domain read, add and remove an app’s domain, and POST /api/v1/apps/{appId}/domain/check checks it now. Adding one below Pro is refused with plan_required, which carries the upgradeUrl. An account can add up to 10 domains an hour (rate_limited).

Was this page helpful?