Skip to content

Commit

Permalink
adds docs for webhook_loader_url
Browse files Browse the repository at this point in the history
  • Loading branch information
janthurau committed Nov 22, 2024
1 parent 08f3183 commit e275565
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/content/collaboration/core-concepts/webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ If your account was created before March, 2024 and you're using an older version
This upgrade is necessary to accommodate the introduction of multiple new events being routed to the same webhook endpoint, distinguished by a new `type` and `trigger` field.

If you do not wish to use the comments webhook, no upgrade is necessary.

# Loader Webhook

In order to initialize documents, you can use the `webhook_loader_url` setting (see [configure runtime](/collaboration/operations/configure)). This URL will be called if a new document is requested.
The webhook will contain a header `Authorization` with your secret, and `document-name` with the name of the requested document.

If you return a yjs update (Y.encodeStateAsUpdate on your side), it will be applied to the document. If you return anything else, the document will be initialized with an empty document.
Note that the loader webhook is called only once when the document is created.
1 change: 1 addition & 0 deletions src/content/collaboration/operations/configure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Several settings can be adjusted dynamically:
| `allowed_origins` | Validates `Origin` headers against the provided values (comma separated), e.g., `https://test.tiptap.dev,https://prod.tiptap.dev`; If not set, validation is disabled |
| `authentication_disabled` | Set to `1` to disable authentication, `0` to enable (default: `0`) |
| `webhook_url` | URL for receiving webhook callbacks |
| `webhook_loader_url` | Optional webhook URL for initially loading documents. See [webhooks](/collaboration/core-concepts/webhooks#loader-webhook) for more information. |
| `webhook_version` | Version of the webhook |
| `webhook_awareness` | Enable awareness webhooks for user activity, tracking `user.connected` and `user.disconnected` events (`1` for enabled, `0` for disabled) |
| `webhook_log_errors_only` | Log only webhook errors; successful webhook logs are disabled |
Expand Down

0 comments on commit e275565

Please sign in to comment.