An open API service indexing awesome lists of open source software.

https://github.com/resend/supabase-auth-hooks-with-resend-templates


https://github.com/resend/supabase-auth-hooks-with-resend-templates

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

## Add the following to .env.local:

```
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
```

Add the following to .env:

```
RESEND_API_KEY=your-resend-api-key
SEND_EMAIL_HOOK_SECRET=your-hook-secret
SENDER_EMAIL=your-sender-email
```

## Push two items to Supabase:

1. env variables

```
supabase secrets set --env-file .env
```

1. send auth emails function
```
supabase functions deploy send-auth-emails --no-verify-jwt`
```

## Add auth hooks to Supabase:

- Enable auth hooks in Supabase dashboard
- Add an HTML webhook
- Generate a secret key

See [Supabase documentation](https://supabase.com/docs/guides/auth/auth-hooks) for auth hooks more information.

## Update .env file

Add the Supabase auth hook secret to the .env file.

Then push the changes to Supabase:

```
supabase secrets set --env-file .env
```