Skip to content

Quickstart

In the console, open Hive Realtime and click New app. Give it a name and pick the region closest to your users. The app page shows its App ID, Key, Host and, on request, its Secret.

The host is realtime-<region>.dockhive.io, for example realtime-eu.dockhive.io. The key and host are safe to put in browser and mobile apps; keep the secret on your server.

Terminal window
npm install pusher-js
import Pusher from 'pusher-js';
const pusher = new Pusher('YOUR_APP_KEY', {
wsHost: 'realtime-eu.dockhive.io',
wsPort: 443,
wssPort: 443,
forceTLS: true,
enabledTransports: ['ws', 'wss'],
cluster: 'eu',
});
const channel = pusher.subscribe('orders');
channel.bind('order-shipped', (data) => {
console.log('Shipped:', data);
});
Terminal window
npm install pusher
import Pusher from 'pusher';
const pusher = new Pusher({
appId: 'YOUR_APP_ID',
key: 'YOUR_APP_KEY',
secret: process.env.REALTIME_SECRET,
host: 'realtime-eu.dockhive.io',
useTLS: true,
});
await pusher.trigger('orders', 'order-shipped', { id: 1042 });

Open the app’s Debug console in DockHive to watch connections, subscriptions and events as they happen.