From e275565018937fe1995f85b285f8c1934464416d Mon Sep 17 00:00:00 2001 From: Jan Thurau Date: Fri, 22 Nov 2024 11:31:56 +0100 Subject: [PATCH] adds docs for webhook_loader_url --- src/content/collaboration/core-concepts/webhooks.mdx | 8 ++++++++ src/content/collaboration/operations/configure.mdx | 1 + 2 files changed, 9 insertions(+) diff --git a/src/content/collaboration/core-concepts/webhooks.mdx b/src/content/collaboration/core-concepts/webhooks.mdx index 7d03158..c8ce512 100644 --- a/src/content/collaboration/core-concepts/webhooks.mdx +++ b/src/content/collaboration/core-concepts/webhooks.mdx @@ -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. \ No newline at end of file diff --git a/src/content/collaboration/operations/configure.mdx b/src/content/collaboration/operations/configure.mdx index 6ac8d4a..81e4762 100644 --- a/src/content/collaboration/operations/configure.mdx +++ b/src/content/collaboration/operations/configure.mdx @@ -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 |