Back to docs

Getting started

Connect your first realtime app

This is the safest first path for connecting a new app. Create the app, trust your website origin, use the public key on the client, and keep private authorization inside trusted server code.

Step 01

Create a realtime app

An app is an isolated realtime project. It has its own app ID, public key, secret preview, allowed origins, region, environment, and limits.

Step 02

Add trusted origins

Allowed origins tell DomVia Realtime which websites are allowed to connect. Add your production domain before real users connect.

Step 03

Use the public key on clients

The public key is safe for browser, mobile, and client SDK setup. It identifies the app that should receive the realtime connection.

Step 04

Authorize private access

For private and presence channels, your trusted server route should verify the user and return a signed authorization response.

example

const realtime = new DomViaRealtime({
  key: "pk_live_your_public_key",
  host: "ws.domvia.net",
});

const channel = realtime.subscribe("private-chat.room.42");

channel.on("message.new", (event) => {
  console.log("New message:", event);
});