Skip to content

Commit 9d88e2e

Browse files
authored
Adds the missing docs on webhooks. (supabase#269)
* Adds missing documentation for webhooks. * Clarifies the unit. * Extends JWS description for webhooks. * Fixes typos. * Typos are like bugs. They don't disappear without changes.
1 parent 4ee3b0e commit 9d88e2e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,27 @@ Default Content (if template is unavailable):
289289
<p><a href="{{ .ConfirmationURL }}">Change Email</a></p>
290290
```
291291

292+
`WEBHOOK_URL` - `string`
293+
294+
Url of the webhook receiver endpoint. This will be called when events like `validate`, `signup` or `login` occur.
295+
296+
`WEBHOOK_SECRET` - `string`
297+
298+
Shared secret to authorize webhook requests. This secret signs the [JSON Web Signature](https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41) of the request. You *should* use this to verify the integrity of the request. Otherwise others can feed your webhook receiver with fake data.
299+
300+
`WEBHOOK_RETRIES` - `number`
301+
302+
How often GoTrue should try a failed hook.
303+
304+
`WEBHOOK_TIMEOUT_SEC` - `number`
305+
306+
Time between retries (in seconds).
307+
308+
`WEBHOOK_EVENTS` - `list`
309+
310+
Which events should trigger a webhook. You can provide a comma separated list.
311+
For example to listen to all events, provide the values `validate,signup,login`.
312+
292313
## Endpoints
293314

294315
GoTrue exposes the following endpoints:
@@ -368,7 +389,7 @@ GoTrue exposes the following endpoints:
368389
"password": "12345abcdef"
369390
}
370391
```
371-
392+
372393
`password` is required for signup verification if no existing password exists.
373394

374395
Returns:

example.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ GOTRUE_MAILER_SUBJECTS_RECOVERY="Reset your GoTrue password!"
1616
GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=http://localhost:9999/callback
1717
GOTRUE_LOG_LEVEL=DEBUG
1818
GOTRUE_OPERATOR_TOKEN=super-secret-operator-token
19+
20+
GOTRUE_WEBHOOK_URL=http://register-lambda:3000/
21+
GOTRUE_WEBHOOK_SECRET=test_secret
22+
GOTRUE_WEBHOOK_RETRIES=5
23+
GOTRUE_WEBHOOK_TIMEOUT_SEC=3
24+
GOTRUE_WEBHOOK_EVENTS=validate,signup,login

0 commit comments

Comments
 (0)