Using Coze Chat SDK

Feb 26, 2026 · 2 min read · 222 Words · -Views -Comments · AI Tutorials
AI Coze 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

Recently I’ve been looking into integrating the Coze Chat SDK into my site to provide an online customer service feature. Here are some notes and takeaways.

Configuration

chatClientInstance = new CozeWebSDK.WebChatClient({
  config: {
    type: 'bot',
    bot_id: 'xxxx',
    isIframe: false
  },
  auth: {
    type: 'token',
    token: token,
    onRefreshToken: refreshAccessToken
  },
  userInfo: {
    id: 'user',
    nickname: 'User'
  },
  ui: {
    base: {
      layout: 'pc',
      lang: 'zh-CN',
      zIndex: 1000
    },
    header: {
      isShow: true,
      isNeedClose: true
    },
    asstBtn: {
      isNeed: true
    },
    footer: {
      isShow: true,
      expressionText: 'Powered by '
    },
    chatBot: {
      title: 'Chat',
      uploadable: false,
      width: 390
    }
  }
});

Additional Notes

  1. For testing, you can directly use a PAT (Personal Access Token) created on Coze. But for production that’s not appropriate — for a pure frontend approach, I went with OAuth.
  2. Voice input currently doesn’t have an official toggle to disable it. If you don’t want this feature, you can hide it via CSS.

Full configuration reference is available here.

Pricing

  1. For personal use, the free tier is fine. But if you want to customize things like component icons, you’ll need the enterprise tier. Quota limits can also be an issue.

Final Thoughts

From testing so far, for basic customer service functionality, the integration is simple enough. As for AI responses, you just need to maintain the agent separately.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover