Quick start
Copy your snippet from Settings -> Install in the console and paste it before the closing </body> tag on every page. That is it, the chat bubble appears in the corner.
<script src="https://wedget.app/widget.js"
data-app-id="icw_xxxxxxxxxxxxxxxxxxxxxxxx"
defer></script>
Your data-app-id is unique to your workspace. The widget loads in an isolated iframe, so it never clashes with your site's CSS or JavaScript.
Position the widget
By default the widget sits in the bottom-right corner. Move it to the left, or place it at a custom distance from the edges, with simple data attributes, no code required.
Left or right
<script src="https://wedget.app/widget.js"
data-app-id="icw_..."
data-position="left" // "left" or "right" (default)
defer></script>
Custom placement
Nudge the widget away from the corner, for example to clear a cookie banner or a floating cart, with data-offset-x (distance from the side edge) and data-offset-y (distance from the bottom), in pixels. They apply to both the button and the open panel.
<script src="https://wedget.app/widget.js"
data-app-id="icw_..."
data-position="right"
data-offset-x="28" // 28px in from the right edge
data-offset-y="96" // 96px up from the bottom
defer></script>
Use your own button
Prefer to open the chat from a link in your nav, a "Contact us" button, or anything else? Turn off our floating bubble in Settings -> Launcher ("Use my own button"), then call the API from any element. You can also set the button size there (Small / Medium / Large).
<button onclick="SoftbetChat('open')">Chat with us</button>
<!-- or toggle open/closed from a nav link -->
<a href="#" onclick="SoftbetChat('toggle'); return false">Support</a>
JavaScript API
Once widget.js has loaded, a global SoftbetChat(command, arg) function is available. Calls made before it loads are queued and replayed.
| Command | What it does |
|---|---|
SoftbetChat('open') | Open the chat panel. |
SoftbetChat('close') | Close the panel. |
SoftbetChat('toggle') | Open if closed, close if open. |
SoftbetChat('showNewMessage', 'Hi!') | Open and start a new conversation, optionally prefilled. |
SoftbetChat('showArticle', 'slug') | Open the help center to a specific article. |
SoftbetChat('identify', {...}) | Attach the logged-in customer, see below. |
Identify your customers
Tell Wedget who the visitor is so your agents see a real name, email and any custom details instead of "Anonymous". Call identify after the visitor logs in.
SoftbetChat('identify', {
name: 'Jane Doe',
email: 'jane@example.com',
attributes: { // any custom fields you want agents to see
plan: 'Pro',
signed_up: '2026-01-12',
lifetime_value: '1240'
}
});
Verified identity (recommended)
To prove a visitor really is who they say (so nobody can impersonate a customer), send a signed user_id. Compute an HMAC of the user id with your workspace Identity secret (Settings -> Install) on your server, never in the browser.
const crypto = require('crypto');
const user_hash = crypto.createHmac('sha256', IDENTITY_SECRET)
.update(String(user.id)).digest('hex');
// send user.id + user_hash to the page, then:
SoftbetChat('identify', { user_id: user.id, user_hash, name, email });
$user_hash = hash_hmac('sha256', (string)$user->id, $IDENTITY_SECRET);
// pass $user->id and $user_hash into your identify() call
You can also pass the same fields at load time with data-user-id and data-user-hash on the script tag.
Shopify
Connect your store in Settings -> Integrations -> Shopify and approve the one-click install. Wedget then:
- syncs your product catalog so the AI can recommend products by name and show product cards in chat;
- lets the AI look up order status for a customer;
- can issue a discount code during a conversation.
The widget is the same one-line snippet, the storefront integration runs through the approved Shopify app, no theme editing needed.
WooCommerce
No plugin needed. Drop the widget snippet in your theme header.php (or via a header-scripts plugin), then add this to your child theme functions.php to identify logged-in customers and push their orders to Wedget. Create an API key first in Settings -> Developers.
// 1) Identify the logged-in customer in the widget
add_action('wp_footer', function () {
if (!is_user_logged_in()) return;
$u = wp_get_current_user();
$hash = hash_hmac('sha256', (string) $u->ID, 'YOUR_IDENTITY_SECRET');
echo "<script>SoftbetChat('identify', " . json_encode([
'user_id' => (string) $u->ID, 'user_hash' => $hash,
'name' => $u->display_name, 'email' => $u->user_email,
]) . ");</script>";
});
// 2) Push each order to the customer's Wedget activity timeline
add_action('woocommerce_order_status_changed', function ($order_id) {
$o = wc_get_order($order_id);
wp_remote_post('https://api.wedget.app/v1/chat/ingest/records', [
'headers' => ['Authorization' => 'Bearer wgk_YOUR_KEY', 'Content-Type' => 'application/json'],
'body' => json_encode([
'external_id' => (string) $o->get_customer_id(),
'records' => [[
'kind' => 'order', 'reference' => (string) $order_id,
'title' => 'Order #' . $order_id,
'amount' => (float) $o->get_total(), 'currency' => $o->get_currency(),
'status' => $o->get_status(),
]],
]),
]);
});
The external_id ties the order to the same customer you identified in step 1 (use your WordPress user id in both places).
Customer-Data API
A server-to-server REST API to stream your customers' identity and activity (orders, deposits, withdrawals, payments) into Wedget. Agents see a live timeline in the conversation panel, the AI can answer account questions like "what is the status of my last deposit?", and the customer sees a tidy "Your activity" card in the widget.
Authentication
Create a key in Settings -> Developers. You will see it once, store it as a server-side secret. Send it as a Bearer token. Keys are scoped per workspace, never expose one in the browser.
Authorization: Bearer wgk_xxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Base URL: https://api.wedget.app
| Endpoint | Scope | What it does |
|---|---|---|
POST /v1/chat/ingest/identify | identify | Create or update a customer profile by external_id. |
POST /v1/chat/ingest/records | records | Append or update activity (orders/deposits/withdrawals/payments). |
POST /v1/chat/ingest/products | products | Upsert a product catalog for AI grounding + cards. |
DELETE /v1/chat/ingest/records | records | Remove one record by reference. |
Identify a customer
external_id is your own stable user id and the key everything links to. Everything except external_id is optional, send only what you have. attributes are merged, so you can enrich the profile over time.
curl https://api.wedget.app/v1/chat/ingest/identify \
-H "Authorization: Bearer wgk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "cust_42",
"name": "Jordan Lee",
"email": "jordan@example.com",
"username": "jlee",
"avatar_url": "https://cdn.you.com/u/42.png",
"phone": "+44 7700 900123",
"address": "12 King St, London",
"attributes": { "vip_tier": "Gold", "lifetime_spend": "2480" }
}'
Push activity records
Each record needs a kind (order, deposit, withdrawal, payment or custom) and a reference unique within that kind, posting the same reference again updates it (so you can stream status changes). Amounts are major units (19.99) or pass amount_cents.
await fetch('https://api.wedget.app/v1/chat/ingest/records', {
method: 'POST',
headers: { Authorization: 'Bearer wgk_YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
external_id: 'cust_42',
records: [
{ kind: 'deposit', reference: 'DEP-77', amount: 50, currency: 'USD', status: 'completed' },
{ kind: 'withdrawal', reference: 'WD-9', amount: 20, currency: 'USD', status: 'pending' }
]
})
});
| Field | Type | Notes |
|---|---|---|
kind | string | order, deposit, withdrawal, payment, custom. Required. |
reference | string | Your id for this item. Unique per kind. Required. Re-post to update. |
title | string | Shown to agents + the customer. |
amount / amount_cents | number | Major units, or integer cents. |
currency | string | ISO code, e.g. USD. |
status | string | Free text, color-coded (paid/completed = green, pending = amber, failed/refunded = red). |
url | string | Deep link agents can open. |
occurred_at | ISO date | Defaults to now. |
Push products
curl https://api.wedget.app/v1/chat/ingest/products \
-H "Authorization: Bearer wgk_YOUR_KEY" -H "Content-Type: application/json" \
-d '{ "products": [
{ "external_id": "sku1", "title": "Pro Plan", "price": 199, "currency": "USD",
"url": "https://you.com/pro", "image_url": "https://you.com/pro.png" }
] }'
What the widget can receive
Beyond the basics, you can stream rich customer context to Wedget so your agents (and the AI) always know who they are talking to. All of it is optional, send only what is useful.
| Data | How | Where it shows |
|---|---|---|
| Name, email, username | identify | Agent console + AI |
| Profile picture, address, phone | identify attributes | Agent console |
| Custom attributes (plan, tier, LTV...) | identify attributes | Agent console + AI |
| Products | Shopify or the Data API | AI + product cards |
| Orders + status | Shopify or the Data API | Agent console + AI |
| Deposits / withdrawals / payments + status | Customer Data API | Agent console + AI + widget |