How to debug ChatGPT app widget in ChatGPT Android App

It would be appreciated if some one can advise:

  1. In a ChatGPT App widget, how to detect whether it is in a ChatGPT web or App mode, is it checking window.openai.userAgent?
  2. How to debug a widget when test in ChatGPT App in an Android phone?
1 Like

Hi @amoywolf

I’d avoid relying on window.openai.userAgent unless OpenAI documents it as a stable contract. I’m not seeing an official Apps/ChatKit doc that guarantees that property, so capability detection is the safer path than UA sniffing.

For debugging, I’d separate:

widget logic — reproduce first in browser / standard ChatKit flow

host-specific behavior — then compare against the app surface

Official starting points:

ChatKit overview: https://platform.openai.com/docs/guides/chatkit⁠

ChatKit widgets: https://platform.openai.com/docs/guides/chatkit-widgets⁠

Advanced/custom ChatKit integrations: https://platform.openai.com/docs/guides/custom-chatkit⁠

So my rule would be: don’t depend on undocumented host detection, prefer feature checks, and isolate web-vs-app behavior with strong widget-side logging.