Customising
While this template is designed to be as simple as possible, with the intention of you enhancing it further, there are a few changes you might want to make.
Change PostgreSQL host#
This template expects a PostgreSQL database, and uses Drizzle ORM to interface with it. Out of the box, Drizzle is configured to use Neon, but you can change this to any other PostgreSQL host.
- In
db/db.ts
, change thesql
variable to point to your PostgreSQL host of choice, so long as Drizzle has an adapter for it.
See Drizzle ORM’s documentation for more information.
Add other Auth.js providers#
This template uses Google Sign-in, but you can add other providers Auth.js supports.
- Browse the available providers in Auth.js’s documentation
- Add the required environment variables for your new provider to
.env
- In
src/lib/auth.ts
, add the provider to theproviders
array (and be sure to import it!) - On your sign in and sign up pages, add
<SocialSignInButton provider="new_provider" />
component wherenew_provider
is the name of the provider you added
Change Email Provider#
By default, this template uses Resend to send magic links. You can change this to any other email provider that Auth.js supports.
See Auth.js’s documentation for more information on which email providers Auth.js supports. You’ll need to update lib/auth.ts
and actions/magic-auth.ts
to support the new provider.