Chat and stablecoin payments, inside your own web product — added with one script tag.

Your members talk and settle in USDT or USDC without leaving your site, and every payment they agree to share is recorded in your own system as it happens — not in someone else's app.

The whole integration, on one screen

On the left, a platform like yours. Switch to After to see exactly what the widget adds. On the right, the real code that adds it. The outlined, numbered parts on the left match the numbered lines in the code — hover or focus either side to light up the other.

Your page
Meridian OTC
DeskDealsLedger
Counterparties Signed in · Meridian desk
Lagos FX Desk KYB ✓ on chat
Kano Imports Ltd KYB ✓ on chat
Trade ledger
CounterpartyAmountSource
Lagos FX Desk2,500 USDTfrom chat
Kano Imports Ltd2,000 USDTManual entry
Adaeze O.400 USDTScreenshot
What you add
index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>EXTRA SAFE widget — plain HTML example</title>
    <style>
      body { font: 15px/1.5 system-ui, sans-serif; max-width: 640px; margin: 40px auto; padding: 0 16px; }
      button { font: inherit; padding: 8px 14px; border: 1px solid #ccc; border-radius: 8px; background: #fff; cursor: pointer; }
      .row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
    </style>
  </head>
  <body>
    <h1>Counterparties</h1>
    <p>This page runs the widget in <b>demo mode</b> (no backend configured).</p>

    <!-- Your own buttons, wired declaratively — no JS glue needed.

         The address here is a demo placeholder. -->
    <div class="row">
      <span>Lagos FX Desk</span>
      <button data-extrasafe-message="0x71C7656EC7ab88b098defB751B7401B5f6d8976F">Message</button>
      <button
        data-extrasafe-pay="0x71C7656EC7ab88b098defB751B7401B5f6d8976F"

        data-amount="2500"
        data-token="USDT"
        data-network="BNB Smart Chain"
        data-reference="D-1042"
      >
        Pay 2,500 USDT
      </button>
    </div>

    <!-- Open the panel from your own nav, with launcher hidden. -->
    <div class="row">
      <button data-extrasafe-open>Open Messages</button>
    </div>

    <!-- The whole client-side integration: one script tag + init().

         Swap the src for /widget.js during local development. -->
    <script src="https://widget.extrasafe.net/v0/widget.js"></script>

    <script>
      ExtraSafe.init({
        host: 'example',
        brand: { name: 'Example OTC', accentColor: '#0b5fff', theme: 'light' },

        user: { platformUserId: 'u_42', displayName: 'You' },
        members: [

          {
            platformUserId: 'u_lagos',
            displayName: 'Lagos FX Desk',
            address: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
            kyc: { status: 'verified', label: 'KYB' },
          },
        ],
        onTransfer: function (e) {

          // In production: POST e to your server and verify e.txHash on-chain.

          console.log('[example] transfer', e);
        },
        onError: function (err) {
          console.warn('[example] error', err.code, err.message);
        },
      });
    </script>
  </body>
</html>
App.tsx
import { ExtraSafeProvider, useExtraSafe } from './useExtraSafe';

// Runnable sketch: wrap your app in <ExtraSafeProvider> and drive the widget

// from your own buttons. Runs in demo mode (no endpoints configured).


const MEMBERS = [
  {
    platformUserId: 'u_lagos',
    displayName: 'Lagos FX Desk',
    address: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
    kyc: { status: 'verified' as const, label: 'KYB' },
  },
];

function Counterparty() {
  const es = useExtraSafe();
  const addr = MEMBERS[0].address;
  return (
    <div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
      <span>{MEMBERS[0].displayName}</span>
      <button onClick={() => es?.openChatWith(addr)}>Message</button>
      <button
        onClick={() =>
          es?.startTransferTo(addr, {
            amount: '2500',
            token: 'USDT',
            network: 'BNB Smart Chain',
            reference: 'D-1042',
          })
        }
      >
        Pay 2,500 USDT
      </button>
    </div>
  );
}

export default function App() {
  return (
    <ExtraSafeProvider
      config={{
        host: 'example',
        brand: { name: 'Example OTC', accentColor: '#0b5fff' },
        user: { platformUserId: 'u_42', displayName: 'You' },
        members: MEMBERS,
        onTransfer: (e) => console.log('[example] transfer', e),
      }}
    >
      <h1>Counterparties</h1>
      <Counterparty />
    </ExtraSafeProvider>
  );
}
useExtraSafe.tsx
import {
  createContext,
  useContext,
  useEffect,
  useRef,
  useState,
  type ReactNode,
} from 'react';
import type { ExtraSafeApi, HostConfig } from '../../extrasafe-widget';

// Minimal React integration for the EXTRA SAFE widget: load widget.js once,

// init once, re-init when the signed-in user changes, and clean up on unmount.

// Drop <ExtraSafeProvider config={...}> near your app root and read the handle

// with useExtraSafe().


const WIDGET_SRC = 'https://widget.extrasafe.net/v0/widget.js';
const Ctx = createContext<ExtraSafeApi | null>(null);

function loadScript(src: string): Promise<void> {
  return new Promise((resolve, reject) => {
    if (window.ExtraSafe && typeof window.ExtraSafe.init === 'function') return resolve();
    const existing = document.querySelector<HTMLScriptElement>(`script[src="${src}"]`);
    if (existing) {
      existing.addEventListener('load', () => resolve(), { once: true });
      existing.addEventListener('error', () => reject(new Error('load failed')), { once: true });
      return;
    }
    const s = document.createElement('script');
    s.src = src;
    s.async = true;
    s.onload = () => resolve();
    s.onerror = () => reject(new Error('load failed'));
    document.head.appendChild(s);
  });
}

export function ExtraSafeProvider({
  config,
  children,
}: {
  config: HostConfig;
  children: ReactNode;
}) {
  const [api, setApi] = useState<ExtraSafeApi | null>(null);
  const userKey = config.user?.platformUserId ?? '';
  const configRef = useRef(config);
  configRef.current = config;

  useEffect(() => {
    let cancelled = false;
    loadScript(WIDGET_SRC)
      .then(() => {
        if (cancelled) return;
        setApi(window.ExtraSafe.init(configRef.current));
      })
      .catch((e) => console.warn('[extrasafe] script load failed', e));
    return () => {
      cancelled = true;
      window.ExtraSafe?.destroy();
    };
    // Re-init when the signed-in host user changes (fresh wallet namespace).

  }, [userKey]);

  return <Ctx.Provider value={api}>{children}</Ctx.Provider>;
}

/** The widget handle, or null until widget.js has loaded and init() has run. */
export function useExtraSafe(): ExtraSafeApi | null {
  return useContext(Ctx);
}
ExtraSafeWidget.tsx
'use client';

import Script from 'next/script';
import { useEffect, useRef } from 'react';
import type { HostConfig } from '../../extrasafe-widget';

// Next.js App Router client component. Loads widget.js with next/script and

// (re)initialises when the signed-in user changes. Mount it once in a client

// boundary (e.g. a layout). Runs in demo mode unless you pass `endpoints`.


const WIDGET_SRC = 'https://widget.extrasafe.net/v0/widget.js';

export function ExtraSafeWidget({ config }: { config: HostConfig }) {
  const ready = useRef(false);
  const configRef = useRef(config);
  configRef.current = config;
  const userKey = config.user?.platformUserId ?? '';

  useEffect(() => {
    if (ready.current && window.ExtraSafe) {
      window.ExtraSafe.init(configRef.current); // re-init on user change

    }
    return () => {
      window.ExtraSafe?.destroy();
    };
  }, [userKey]);

  return (
    <Script
      src={WIDGET_SRC}
      strategy="afterInteractive"
      onLoad={() => {
        ready.current = true;
        window.ExtraSafe.init(configRef.current);
      }}
    />
  );
}
page.tsx
'use client';

import { ExtraSafeWidget } from './ExtraSafeWidget';

// Example App Router page. In a real app, mount <ExtraSafeWidget> once in a

// client layout and read the signed-in user from your auth/session. Buttons use

// the declarative attributes, so no imperative glue is needed here.


const PEER = '0x71C7656EC7ab88b098defB751B7401B5f6d8976F';

export default function Page() {
  return (
    <main style={{ maxWidth: 640, margin: '40px auto', fontFamily: 'system-ui' }}>
      <h1>Counterparties</h1>
      <div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
        <span>Lagos FX Desk</span>
        <button data-extrasafe-message={PEER}>Message</button>
        <button
          data-extrasafe-pay={PEER}
          data-amount="2500"
          data-token="USDT"
          data-network="BNB Smart Chain"
          data-reference="D-1042"
        >
          Pay 2,500 USDT
        </button>
      </div>

      <ExtraSafeWidget
        config={{
          host: 'example',
          brand: { name: 'Example OTC', accentColor: '#0b5fff' },
          user: { platformUserId: 'u_42', displayName: 'You' },
          members: [
            {
              platformUserId: 'u_lagos',
              displayName: 'Lagos FX Desk',
              address: PEER,
              kyc: { status: 'verified', label: 'KYB' },
            },
          ],
          onTransfer: (e) => console.log('[example] transfer', e),
        }}
      />
    </main>
  );
}

This is the whole client-side integration.

  1. ① The <script> tag loads the widget.
  2. ② brand sets the panel header and accent colour.
  3. ③ user and members — the signed-in member and your suggested counterparties, with their KYC chip.
  4. ④ data-extrasafe-message / -pay on your own buttons open the chat or a pre-filled payment.
  5. ⑤ onTransfer gives you the new ledger row.

What happens when a member pays

  1. 1

    Agree the trade in chat.

  2. 2
    2,500USDTfrom deal D-1042

    Tap Pay — amount, token and reference pre-filled from the deal.

  3. 3
    Transfer2,500 USDTconfirmed

    A transfer card appears in the conversation.

  4. 4

    Your ledger receives the event.

onTransfer(e) — the event your server receives
{
  "txHash": "0x4b9f…c21a",
  "amount": "2500",
  "token": "USDT",
  "network": "BNB Smart Chain",
  "from": "0x71C7…976F",
  "to": "0x8aE2…0b1D",
  "reference": "D-1042",
  "timestamp": 1731763200000,
  "sandbox": false
}

Verify the hash on-chain on your server before you trust it. onTransfer is a browser claim — see “Receiving transfers” in the integration guide.

What your platform sees, and what it does not

Your platform sees

  • Which of your members activated chat, and their wallet address.
  • Transfer events a member agrees to share with you.

Your platform does not see

  • Message contents.
  • Recovery phrases.
  • Private keys.

Keys are created and kept in the member's browser, and messages are encrypted end to end — so neither your platform nor EXTRA SAFE can read them.

What it takes to integrate

  1. ~5 min Add the script tag and ExtraSafe.init(...).
  2. small Pass your signed-in user (platformUserId, displayName).
  3. small Mark up your own buttons with data-extrasafe-message / -pay.
  4. 1 endpoint Store the member's wallet address when they activate (identity binding).
  5. 1 endpoint Receive onTransfer and verify txHash on-chain before crediting.

Full integration guide →

Available now, and not yet

Available now

  • 1:1 end-to-end encrypted text chat.
  • In-chat USDT / USDC transfers on BNB Smart Chain and Avalanche, with gas settled in the stablecoin.
  • Host branding (name and accent colour).
  • Consent-gated transfer events to your ledger.
  • Sandbox wallet mode for staging — real chat, simulated transfers.

Not yet

  • TRON (today it appears only as manually recorded rows).
  • Group chat and calls in the widget.
  • Approvals, multisig and escrow.
  • A signed server-to-server transfer webhook.

Browser key storage is awaiting a security review before a real launch.

See it in a full system

  1. Find a counterparty in the directory.
  2. Pay from the deal room — amount pre-filled.
  3. Admin reports: volume, reconciliation, CSV.

Open the demo marketplace