Setting up DDP

Getting hooked into the API is fairly straightforward.

The following examples will assume you're using the ddp library.

Install DDP

npm install ddp

Set up and connect to DDP

const DDP = require('ddp');

/* Prepare the client */
const DDPClient = new DDP({
    url: 'wss://atshop.io/websocket',
});

/* Connect to the server */
DDPClient.connect((err, reconnected) => {
    if (err) {
        throw err;
    }

    // Successfully connected!

});