API integration
Widget JavaScript API
Control an installed widget through the window.Cliptalk object.
#CliptalkSettings
A settings object defined before the widget script.
| Property | Type | Description |
|---|---|---|
user | object | Signed-in customer { id, name, email, phone, hash } |
locale | string | Force the widget language (ko, en, ja, zh-TW, zh-CN) |
window.CliptalkSettings = {
user: { id: 'user_1001', name: 'Alex Kim', email: 'clip@example.com' },
locale: 'en'
};#Cliptalk.identify(user)
JS
Cliptalk.identify(user | null)Updates the customer on sign-in and sign-out. It applies the next time the chat opens. Pass null to return to a guest.
window.Cliptalk.identify({ id: 'user_1001', name: 'Alex Kim' });
window.Cliptalk.identify(null); // sign out#Cliptalk.setLocale(lang)
JS
Cliptalk.setLocale(lang)Changes the widget language. null returns to automatic detection.
window.Cliptalk.setLocale('ja');#Cliptalk.open() / close()
JS
Cliptalk.open() · Cliptalk.close()Opens or closes the chat. Wire it to a button on your site, such as “Contact us”.
<button onclick="window.Cliptalk && Cliptalk.open()">
Chat with us
</button>