The Auth0 SaaS Starter Kit is a full-stack Next.js + Radix UI application designed to help you get started building B2B SaaS with Auth0 by Okta. It features multi-tenancy support, organization member management and access controls, security policies, self-service Single Sign-On configuration, and more.
This file contains steps that you can take for advanced configuration of your local environment. These instructions assume you've already run the Getting Started instructions located in the project's main README.md file.
This section guides you through setting up a reverse proxy server to enable local HTTPS development for your project. The process involves installing Caddy, creating a configuration file (Caddyfile), setting up local domain resolution, and running Caddy.
This setup allows you to access your local development server via HTTPS using a custom domain, mimicking a production environment while working locally. It's particularly useful for testing features that require secure connections or specific domain configurations.
brew install caddy nss
cd ~/Developer/auth0-b2b-saas-starter
touch Caddyfile
Caddyfile
in your favorite code editor or IDE.fake-production-url.com:443 {
reverse_proxy 127.0.0.1:3000
tls internal
}
sudo vi /etc/hosts
or sudo code /etc/hosts
)# SaaStart
127.0.0.1 fake-production-url.com
caddy run
command to start the process.cd ~/work/assemble
caddy run # You will have to enter your password or touch ID to approve the keychain addition
In some cases you might get the error message “ERROR pki.ca.local failed to install root certificate”, but that's not an indication that Caddy is not working.
curl -vI https://fake-production-url.com
Amongst the overall output, you should be able to see the following lines included:
* Server certificate:
* subject: [NONE]
* start date: {unix-style timestamp}
* expire date: {unix-style timestamp}
* subjectAltName: host "fake-production-url.com" matched cert's "fake-production-url.com"
* issuer: CN=Caddy Local Authority - ECC Intermediate
* SSL certificate verify ok.
This section guides you through setting up an email platform for easy local testing and development.
When simulating a production environment on your personal development environment, it can also be helpful to test email delivery and manage transactional emails without actually sending emails to real users. This can be achieved with an email platform of your choice, with this guide focusing on Mailtrap.io as one example. These services can act as a “fake” SMTP email provider, collecting and displaying the email messages it was supposed to send without actually delivering them. This allows you to test email functionality while creating organizations and inviting users while using any email addresses you want, even those that aren't real. This makes a solution like this ideal for troubleshooting and testing SaaStart.
[!IMPORTANT] You must use an email domain that actually exists and has an MX record for testing. For example, using
acme.com
will work, butacmeairlines.net
will not, as it lacks a valid MX record.
587
or 2525
.[!IMPORTANT] When entering the "From" email address in the SMTP Provider Settings, do not include
auth0.com
orokta.com
in the email subdomain, as this will prevent the setup from working.