For the complete documentation index, see llms.txt. This page is also available as Markdown.

原生 JavaScript(ES 模块)

在支持原生 ES 模块的基于浏览器的 JavaScript 应用中直接使用 Convai 的像素流客户端。

<!-- index.html -->
<div id="pixel-stream-container" style="width: 100%; height: 600px;"></div>
<script type="module">
  import { PixelStreamClient } from '/path/to/node_modules/@convai/experience-embed/dist/index.js';

  const container = document.getElementById('pixel-stream-container');
  const client = new PixelStreamClient({ container, expId: 'your-experience-id' });

  client.initializeExperience();
</script>

最后更新于

这有帮助吗?