All Integrations

better-cmdk custom externalchat integration

Custom ExternalChatIntegration Guide

Use a custom ExternalChat adapter when your organization already has an internal chat orchestration layer.

Implementation Notes

This path gives maximum control. You implement the provider contract once, then keep better-cmdk as the stable UI layer while backend providers evolve.

Best For

  • - Teams with internal model gateways and compliance requirements
  • - Products that need custom routing between multiple models
  • - Engineering orgs standardizing one chat API across many apps

Quick Setup Checklist

  1. 1. Implement the ExternalChat-compatible adapter in your shared frontend layer.
  2. 2. Map request and response events to better-cmdk chat expectations.
  3. 3. Attach adapter telemetry for prompt, latency, and failure analysis.
  4. 4. Test fallback behavior when provider timeouts or quota errors occur.

Integration FAQ

Is a custom adapter harder to maintain?

It is more work initially, but it reduces long-term UI churn when backend providers change.

Can I connect multiple providers through one adapter?

Yes. You can route by tenant, feature flag, or request type inside your adapter layer.

What should I test before launch?

Test streaming behavior, auth failures, retries, and action approval flows under real latency.