Quickstart

This page builds a minimal chat app against Vero Messaging using @veroai/chat. By the end you’ll be sending messages and receiving real-time updates.

1. Install

pnpm add @veroai/chat

2. Get a token

Vero Messaging is authenticated with a JWT from the Vero auth service. In production, exchange a user password or OAuth code for one; for quick testing you can mint one via the dashboard.

curl -X POST https://api.veroagents.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"..."}'

3. Create a client

import { ChatClient } from "@veroai/chat";

const chat = new ChatClient({
  token: process.env.VERO_JWT!,
  autoReconnect: true,
});

4. Create a conversation

const { id: conversationId } = await chat.api.createConversation({
  type: "group",
  name: "Support",
  participantIds: ["user_123", "agent_support"], // mix humans + agents freely
});

5. Connect + subscribe

await chat.connect();
chat.subscribe([conversationId]);

chat.on("message.created", (ev, convId) => {
  console.log("new message:", ev.message_id, "in", convId);
});

chat.on("typing.start", (ev) => console.log("typing:", ev.user_id));
chat.on("message.edited", (ev) => console.log("edited:", ev.id));

6. Send a message

await chat.api.send({
  conversationId,
  contentText: "When does my warranty expire?",
});

If any participant is an agent, msgsrv triggers your configured agent runtime via gRPC. The reply lands back in the same conversation as a normal message event.

That’s it

You now have auth, conversations, real-time delivery, and agent routing. Everything else — media uploads, reactions, search, mute, archive, block — is a single SDK call away. See the Chat SDK reference.