docs: update content

This commit is contained in:
Hans Pagel
2020-12-03 17:23:54 +01:00
parent f847bacc62
commit 6342a757ef
6 changed files with 32 additions and 17 deletions

View File

@@ -1,15 +1,9 @@
# Collaborative editing
:::premium Become a sponsor
:::pro Become a sponsor
Using collaborative editing in production? Do the right thing and [sponsor our work](/sponsor)!
:::
<!--
TODO:
- Pass auth token to the provider
-
-->
## toc
## Introduction
@@ -205,6 +199,12 @@ Yes, its magic. As already mentioned, that is all based on the fantastic Y.js
## Store the content
Our collaborative editing backend is ready to handle advanced use cases, like authorization, persistence and scaling. Lets go through a few common use cases here!
:::pro Backend as a Service (Paid)
Dont want to wrap your head around the backend part? No worries, we offer a managed backend. For less than 1.000 documents, its $49/month (VAT may apply) and probably saves you a ton of time.
Send us an email to [humans@tiptap.dev](mailto:humans@tiptap.dev) for further details.
:::
### Authentication
With the `onConnect` hook you can write a custom Promise to check if a client is authenticated. That can be a request to an API, to a microservice, a database query, or whatever is needed, as long as its executing `resolve()` at some point. You can also pass contextual data to the `resolve()` method which will be accessible in other hooks.
@@ -312,6 +312,8 @@ const server = Server.configure({
server.listen()
```
There is no method to restore documents from an external source, so youll need a [persistence driver](#persist-the-document) though. Those persistence drivers store every change to the document. Thats probably not needed in your external source, but is needed to make the merging of changes conflict-free in the collaborative editing backend.
### Scale with Redis (Advanced)
To scale the WebSocket server, you can spawn multiple instances of the server behind a load balancer and sync changes between the instances through Redis. Install the Redis adapter and register it with hocuspocus: