Skip to main content
Your chatbot is never affected by SDK errors. The recordMessages method catches all exceptions internally and will never interrupt your application.

Design philosophy

The SDK is designed to be invisible when things go wrong. recordMessages catches all errors internally, including:
  • Network failures — the OpenBat API is unreachable or times out
  • Invalid responses — the API returns an unexpected response format
  • Timeout errors — the request exceeds the allowed duration
  • Any unexpected errors — anything else that could go wrong
Because analytics should never break your product, the SDK swallows every error so your chatbot continues to work exactly as it would without OpenBat installed.

Console logging

When an error occurs, the SDK logs it to the console for visibility but does not propagate it to your application code. You will see the error in your server logs or terminal output, but no try/catch block is needed around recordMessages.
// No error handling required — the SDK handles it for you
await client.recordMessages({
  conversationId: "conv_123",
  messages: [
    { role: "user", content: "Hello" },
    { role: "assistant", content: "Hi there!" }
  ]
});
// Execution always continues here, even if the request failed

Monitoring SDK health

To verify your integration is working correctly:
  1. Check the OpenBat dashboard — conversations should appear within minutes of your first recordMessages call.
  2. Monitor console logs — look for any SDK error messages in your server output.
  3. Use API response codes — the capture endpoint returns standard HTTP status codes that indicate what went wrong. See the API reference for the full list.

Common issues

SymptomCauseFix
No conversations in dashboardInvalid or missing API keyVerify OPENBAT_API_KEY matches the key shown in your chatbot’s settings.
Conversations appear but no analysisAnalysis pipeline processingWait a few minutes — analysis runs asynchronously after ingestion.
Console shows 401 errorsAPI key expired or rotatedGet the current key from Settings → General in the dashboard.
Console shows 400 errorsInvalid request bodyCheck that every message includes both role and content.
For a full list of status codes and error responses from the capture endpoint, see the API reference.