Adding a custom domain to an environment 

Gadget provisions a free gadget.app subdomain for each app you create, and supports routing your own domains (like my-cool-app.com) to your Gadget app.

Configuring a custom domain is done by messaging Gadget support on Discord.

How custom domains work 

Custom domains are routed to your Gadget app via DNS records. You'll configure your domain to resolve to Gadget's IP address via a CNAME DNS record, and then Gadget will route incoming requests to your app. You can have multiple domains point to the same Gadget app, including your original .gadget.app domain, but only one domain will be identified as the "primary" domain. Requests to domains other than the primary domain will be redirected to the primary domain.

Custom domain requirements 

To route a custom domain to your Gadget app, you will require:

  • a Gadget app with a Production environment
  • purchasing a domain name from a domain registrar
  • DNS records that point your domain name to your Gadget app

Gadget doesn't provide domain registration services or DNS resolution. Gadget only supports custom domains for the Production environment of an application, but reach out to Gadget support if you'd like a more advanced configuration.

Adding a custom domain to an environment 

To add a custom domain to an environment, you will need to:

  1. Create a CNAME record that points your custom domain name to your original gadget.app domain.
  2. Message Gadget support to add the custom domain to your environment. Please include the following information:
    • The domain name you're adding
    • The .gadget.app subdomain of your Gadget app
    • which DNS provider you're using
  3. Update any external URLs that point to your Gadget app to use the new custom domain, which includes URLs in the Shopify Partner Dashboard if building a Shopify app.

For example, if you have a Gadget app at my-cool-app.gadget.app, and you have a custom domain of app.super-company.com, you must create a CNAME DNS record that points app.super-company.com to my-cool-app.gadget.app. In Cloudflare, this DNS record looks like this:

A screenshot of the deployment button and popup in the Gadget editor.

Once you and the Gadget staff are satisfied that the DNS records are correctly configured, the Gadget team will update your app to mark your new custom domain as the primary domain. All requests to any active domain for your app will be redirected to the primary domain.

Apex domain support 

Gadget supports custom domains that use subdomains, like platform.my-company.com, as well as apex domains, like my-cool-app.com. When using an apex domain however, you can't use DNS A records that resolve to an IP address, as this is not supported by Gadget's network infrastructure for security reasons. You must use a CNAME record, and only some DNS providers support this.

If you want to use an apex domain, but your DNS provider doesn't support CNAME records, you can:

  • use a subdomain instead
  • switch to a different DNS provider that supports CNAME records, like Cloudflare

HTTPS support 

Gadget automatically provisions a free SSL certificate for your custom domain and routes requests to your app using the same high-performance global network that powers Gadget's own gadget.app domains.

Was this page helpful?