Skip to main content
Documentation
StartOverviewArchitectureAuthenticationSend your first message
TypeScript SDKOverviewTrusted app serverApp-user clientsRealtimeErrors & webhooks
Flutter SDKOverviewInstallationAuthenticationChannels & messagesOffline & syncRealtimeUI componentsPush & lifecycle
ConceptsTenancy & scopeChannels & messagesDelivery & reconciliationSecurity checklist
ProtocolsRealtimeSigned webhooks
ReferenceREST APIErrors, limits & retriesDeploy docs to Coolify
VV ChatDocs API v1
Recommended starting points
Build chat without rebuilding infrastructureV Chat is a multi-tenant messaging backend with typed server, web, and Flutter integration paths.StartArchitecture at a glanceUnderstand the control plane, data plane, realtime path, and SDK boundaries before integrating.StartAuthentication and credentialsSelect the correct credential for dashboard, trusted-server, app-user, realtime, and webhook flows.StartSend your first messageUse the trusted TypeScript server client to create the minimum safe messaging flow.StartTypeScript SDK overviewChoose the correct typed client for trusted servers, app users, dashboard sessions, realtime, and webhooks.TypeScript SDKTrusted app-server clientUse AppServerClient from a protected backend to manage data-plane resources and mint app-user tokens.TypeScript SDKApp-user clientsBuild browser or Node app-user flows with VChatClient or the lower-level AppUserClient.TypeScript SDK
↑↓ Navigate↵ Openesc Close
API reference
StartOverviewArchitectureAuthenticationSend your first message
TypeScript SDKOverviewTrusted app serverApp-user clientsRealtimeErrors & webhooks
Flutter SDKOverviewInstallationAuthenticationChannels & messagesOffline & syncRealtimeUI componentsPush & lifecycle
ConceptsTenancy & scopeChannels & messagesDelivery & reconciliationSecurity checklist
ProtocolsRealtimeSigned webhooks
ReferenceREST APIErrors, limits & retriesDeploy docs to Coolify
Contract sourceOpenAPI JSON
Docs/Start
Security first

Authentication and credentials

Select the correct credential for dashboard, trusted-server, app-user, realtime, and webhook flows.

Updated 2026-08-09•docs/architecture/AUTHENTICATION_AND_SECRETS.md · SDK public READMEs

Credential map

CredentialWhere it belongsPurpose
Dashboard session cookieV Chat dashboard in the browserControl-plane organization/application administration
Application credentialCustomer server or worker secret storeTrusted data-plane operations and app-user token issuance
App-user bearer tokenBrowser/mobile memory for one user sessionEnd-user REST calls and realtime ticket issuance
Realtime connection ticketIn-memory, one useShort-lived WebSocket handshake authorization
Webhook signing secretReceiving server secret storeVerify raw webhook bytes before parsing

Use a token provider

The browser or Flutter client calls your authenticated backend. Your backend derives the current user ID from its session, asks V Chat for an app-user token with the protected application credential, and returns only the opaque short-lived token.

Browser token provider
async function fetchCurrentUserChatToken({ forceRefresh }: { forceRefresh: boolean }) {
  const response = await fetch('/api/chat/token', {
    method: 'POST',
    credentials: 'same-origin',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ forceRefresh }),
  });

  if (!response.ok) throw new Error('Unable to obtain a chat token');
  return response.json() as Promise<{ token: string; expiresAt?: string }>;
}
Derive identity server-side

Do not accept an arbitrary userId from the device and mint a token for it. Bind the V Chat user identity to the authenticated account in your backend.

Refresh and logout

  • Keep bearer tokens in memory; the released clients do not persist or decode them.
  • Coalesce concurrent refresh work through the SDK token provider boundary.
  • A known expiry is refreshed before its configured skew window; an eligible 401 permits one forced refresh.
  • On logout or account switch, disconnect realtime, revoke device registration when applicable, dispose the client, and clear scoped cached state.
PreviousArchitecture at a glanceNext Send your first message
On this pageCredential mapUse a token providerRefresh and logout
Report a docs issue