Skip to main content

Hooking up to the server

info

This guide introduces the Collaboration Server and requires you to have it installed.

You can install it by running yarn add @pdftron/collab-server

The collab server requires you to provide a set of resolvers in order to link the server to your database.

The default database ships with these resolvers, so there is no need to write your own!

To get the resolvers, use the getResolvers API. You can pass the result directly into the server.

import CollabServer from '@pdftron/collab-server'
import CollabDatabase from '@pdftron/collab-db-postgresql'
const db = new CollabDatabase({
...yourParams
});
await db.connectDB();
const resolvers = db.getResolvers();
const server = new CollabServer({
resolvers,
...otherParams
})
server.start();

Next steps#