IFrames
Cohere supports viewing and interacting with iframes under the same TLD in your web app. Due to browser restrictions around cross-origin site access, Cohere needs to be initialized in the parent site as well as the iframe.
In the parent, initialize Cohere as normal:
1
Cohere.init("INSERT_API_KEY_HERE");
Copied!
In the iframe, initialize Cohere with the childIframe flag set:
1
Cohere.init("INSERT_API_KEY_HERE", { childIframe: true });
Copied!
With this flag set, the iframe will no longer be listed as a separate session in the Cohere dashboard. Instead, it will display normally inside the parent session.
Last modified 1yr ago
Copy link