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/Flutter SDK
Credential boundary

Flutter authentication

Load short-lived app-user tokens from your backend without exposing an application credential.

Updated 2026-08-09•sdks/flutter/packages/v_chat_flutter/README.md · v_chat_core authentication contracts

Implement TokenProvider

dart
import 'package:v_chat_flutter/v_chat_flutter.dart';

final class BackendTokenProvider implements TokenProvider {
  const BackendTokenProvider();

  @override
  Future<AuthToken> getToken({required bool forceRefresh}) {
    return loadCurrentUserVChatToken(forceRefresh: forceRefresh);
  }
}
No application credential in Flutter

Flutter code uses only app-user tokens from your authenticated backend. Never embed an application credential, dashboard session secret, webhook secret, or signing key.

Backend token endpoint

  1. Authenticate the product user with your normal backend session.
  2. Derive the V Chat user ID server-side from that identity.
  3. Use AppServerClient and the protected application credential to issue a bounded token.
  4. Return the opaque token and optional ISO expiry over HTTPS.
  5. Do not return refresh tokens or the application credential.

Logout and account switching

  • Revoke the current device registration before logout when push is attached.
  • Disconnect realtime and stop all listeners.
  • Dispose the client and its owned offline store.
  • Create a fresh SDK and scoped database for the next user; never reuse state across logical sessions.
PreviousInstall the Flutter SDKNext Channels, messages, and threads
On this pageImplement TokenProviderBackend token endpointLogout and account switching
Report a docs issue