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/TypeScript SDK
Safe boundaries

Errors and signed webhooks

Handle typed request failures safely and verify signed webhook bytes before decoding events.

Updated 2026-08-09•packages/sdk-typescript/src/errors/api-error.ts · webhooks/verifier.ts

Typed API errors

ts
import { ApiError } from '@vchatsdk/sdk-typescript';

try {
  await appUser.conversations.query({ limit: 25 });
} catch (error: unknown) {
  if (error instanceof ApiError) {
    renderSafeFailure({
      code: error.code,
      statusCode: error.statusCode,
      retryAfterSeconds: error.retryAfterSeconds,
      requestId: error.requestId,
    });
  }
}
Log metadata, not content

Never log credentials, tokens, cookies, message content, signed URLs, webhook bodies, or arbitrary responses. Stable error code and request ID are the safe support boundary.

Verify the raw webhook request

ts
import { verifyWebhook } from '@vchatsdk/sdk-typescript/webhooks/server';

const event = verifyWebhook({
  headers: request.headers,
  rawBody,
  secrets: [currentSecret, previousSecret].filter(
    (value): value is string => value !== undefined,
  ),
});

dispatchVerifiedEvent(event);

Verify the exact raw bytes before JSON parsing. Enforce the released timestamp tolerance, deduplicate by stable delivery/event identity, return quickly, and move business work to your own durable queue.

Retry decisions

  • A retryable error means a future attempt may succeed; it does not prove a mutation is safe to replay.
  • Respect positive Retry-After guidance with caller-controlled scheduling.
  • For ambiguous fixed-identity mutations, read and reconcile the resource first.
  • Treat authentication, authorization, validation, and resource-not-found outcomes as non-retryable until inputs or authority change.
PreviousTypeScript realtimeNext Flutter SDK overview
On this pageTyped API errorsVerify the raw webhook requestRetry decisions
Report a docs issue