Trading Widget Quick Start

Create a visible container, load the script, and call TradingWidget.create().

View as Markdown

Minimal example

1<div id="trading-widget" style="width: 100%; height: 720px"></div>
2
3<script src="https://app.6mm.com/sdk/trading-widget/v1/index.js"></script>
4<script>
5 const widget = TradingWidget.create('#trading-widget', {
6 baseUrl: 'https://app.6mm.com',
7 symbol: 'BTCUSDT',
8 theme: 'dark',
9 locale: 'en',
10 layout: 'default',
11 display: {
12 showHeader: false,
13 showTicker: false,
14 hidden: [],
15 },
16 onReady(event) {
17 console.log('ready', event)
18 },
19 onError(error) {
20 console.error('error', error)
21 },
22 })
23</script>

SDK URLs

Set baseUrl explicitly

When testing from partner-owned pages, pass baseUrl so the iframe always points to the 6MM Web domain.

Display controls

Partner embeds hide the PC header and bottom market ticker by default. Use display when you need to show those shell areas or hide high-level containers in the embedded trading page.

1display: {
2 showHeader: false,
3 showTicker: false,
4 hidden: ['account'],
5}

Container size

SurfaceRecommended minimum
Desktop1024 x 720
Mobile390 x 700