Custom Domain Name

Use webtasks with your own custom domain name and SSL

For customized documentation and ready to run samples, please log in.

Configure your own custom domain

Auth0 Webtask runtime is normally accessible at You can configure access to webtasks using your own domain name by having your DNS managed by Cloudflare . Cloudflare, in an effort called Universal SSL, enables SSL by default for all their customers. We will be using the Universal SSL mechanism in Full SSL mode. This is completely free. Learn more about this here.

Use our step-by-step instructions to set up access to Auth0 webtasks via your custom domain name.

Get a custom domain

The rest of this setup assumes you own a custom domain name, you have control over the name servers this domain is configured with, and can change them to point to Cloudflare. For the purposes of this tutorial we will be using the domain

Set up your custom domain in Cloudflare

Create a Cloudflare account if you don't have one. Then add a new website through the Cloudflare's dashboard, specifying your custom domain name.

cloudfare-add website

Set up CNAME record from your custom domain to webtasks

Once Cloudflare finishes scanning your DNS records from your current registrar, you will have an opportunity to modify them. Add a new CNAME record that maps your custom domain, in this example, to (or whichever hostname your webtask account is using). Make sure that Cloudflare is enabled for that domain as indicated by the orange cloud in the Status column.

cloudfare-setup cname

Select a Cloudflare plan

Next you will be asked which Cloudflare plan to select. Choose Free Website.

cloudfare-select plan

Switch nameservers to Cloudflare

It is time to pull the trigger. Cloudflare will provide you with new nameserver names which you need to set as the nameservers for your custom domain through your domain registrar.

cloudfare-change nameservers

The process here will be different depending what your domain registrar is. We are using NameCheap and this is what we had to do to configure the nameservers provided by Cloudflare for our custom domain.

namecheap-set nameservers

The change of nameservers requires some time to propagate. Cloudflare dashboard will tell you when the change became effective.

Ensure Full SSL mode is selected

Back in the Cloudflare dashboard, make sure your new custom domain SSL settings are configured with Full SSL mode. This means that SSL is applied all the way from the caller, to Cloudflare, to Auth0 Webtasks.

cloudfare-full ssh

Congratulations, you have just set up custom domain access with SSL to Auth0 Webtasks!

Create a new webtask

Let's create a new webtask using the webtack cli wt. Open a terminal and use the following commands. Of course you can create your webtask based on another JavaScript file. Just skip the first command and modify the second with the valid filename.

$ echo "module.exports = function(cb) { cb(null, 'hello from my custom domain webtask'); }" > hello-custom.js
$ wt create hello-custom.js --host

Notice the --host argument. This argument allows the webtask to be called using your custom domain name and before running the command you should replace the value with your own custom domain.

Note that using this option requires proof of domain ownership. The webtask runtime will validate whether the caller owns the custom domain and if not will throw an error. This validation is done by checking if a TXT record exists in the DNS of the specified custom domain. This TXT record should list the webtask container name and is a statement from the domain owner, permitting webtasks called over that custom domain name to run in a specific webtask container. An example of how TXT records look like in Cloudflare DNS management system:


In this example we have associated our custom domain (host = with two containers (ten = auth0, tjanczuk). You may create as many such TXT records as you need.

Access your webtasks

In order for a webtask to be used with a custom domain it must be created using the host parameter. This is imperative in order to validate the domain's ownership. If you have existing webtasks that you wish to use with a custom domain you will have to create them again using the host parameter.

Once created, your webtasks can be called using the following URL format: https://{custom_domain}/{container_name}/{webtask_name}/....

Note that the webtask management HTTP APIs must be invoked using the shared webtask domain name, e.g.

That's it, you are done! And remember, if you face any issues we are always available for a chat.