Developer documentation

Install Wedget, anywhere,
in one line.

Drop the widget on any site, position it where you want, open it from your own button, and pass your logged-in customer to your support team. Everything below works with a single script tag.

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.

HTML
<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

HTML
<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.

HTML
<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>
Tip: position works the same whether you use our button or your own. With a custom button, the offsets control where the open chat panel appears.

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).

HTML
<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>
When the custom button is on, our floating launcher is hidden and the page stays fully clickable; the chat only appears when you call SoftbetChat('open').

JavaScript API

Once widget.js has loaded, a global SoftbetChat(command, arg) function is available. Calls made before it loads are queued and replayed.

CommandWhat 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.

JavaScript
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.

Node.js (server)
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 });
PHP (server)
$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.

PHP (functions.php)
// 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.

HTTP
Authorization: Bearer wgk_xxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Base URL: https://api.wedget.app
EndpointScopeWhat it does
POST /v1/chat/ingest/identifyidentifyCreate or update a customer profile by external_id.
POST /v1/chat/ingest/recordsrecordsAppend or update activity (orders/deposits/withdrawals/payments).
POST /v1/chat/ingest/productsproductsUpsert a product catalog for AI grounding + cards.
DELETE /v1/chat/ingest/recordsrecordsRemove 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
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.

Node.js (server)
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' }
    ]
  })
});
FieldTypeNotes
kindstringorder, deposit, withdrawal, payment, custom. Required.
referencestringYour id for this item. Unique per kind. Required. Re-post to update.
titlestringShown to agents + the customer.
amount / amount_centsnumberMajor units, or integer cents.
currencystringISO code, e.g. USD.
statusstringFree text, color-coded (paid/completed = green, pending = amber, failed/refunded = red).
urlstringDeep link agents can open.
occurred_atISO dateDefaults to now.

Push products

cURL
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" }
  ] }'
Privacy + safety. Keys are workspace-scoped and a customer only ever sees their own activity (matched on the verified widget session). Push only the fields you want agents and the AI to use, all of them are optional.

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.

DataHowWhere it shows
Name, email, usernameidentifyAgent console + AI
Profile picture, address, phoneidentify attributesAgent console
Custom attributes (plan, tier, LTV...)identify attributesAgent console + AI
ProductsShopify or the Data APIAI + product cards
Orders + statusShopify or the Data APIAgent console + AI
Deposits / withdrawals / payments + statusCustomer Data APIAgent console + AI + widget
Customer Data API. A server-to-server REST API (per-workspace API keys) to push orders, deposits, withdrawals, payments and a full customer profile, so agents see a live activity timeline and the AI can answer "what is the status of my last deposit?". See the Customer-Data API reference and create a key in Settings -> Developers.