File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,22 @@ export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
1717 * If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
1818 */
1919 baseUrl ?: string
20+
21+ /**
22+ * Only fill this if you are using Tiptap Collab HA.
23+ */
24+ shardKey ?: string
2025}
2126
2227export class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
2328 constructor ( configuration : TiptapCollabProviderWebsocketConfiguration ) {
24- super ( { ...configuration as HocuspocusProviderWebsocketConfiguration , url : configuration . baseUrl ?? `wss://${ configuration . appId } .collab.tiptap.cloud` } )
29+ let url = configuration . baseUrl ?? `wss://${ configuration . appId } .collab.tiptap.cloud`
30+
31+ if ( configuration . shardKey ) {
32+ url += url . includes ( '?' ) ? '&' : '?'
33+ url += `shard=${ configuration . shardKey } `
34+ }
35+
36+ super ( { ...configuration as HocuspocusProviderWebsocketConfiguration , url } )
2537 }
2638}
You can’t perform that action at this time.
0 commit comments