Skip to content

Widget types

Widget types

First thing to know is that there are two versions of the widget

  • Static widget
  • Floating widget

Static widget

Static widget is attached to the element you pass during initialization. Both toggler and content is positioned statically and they affect width and height of element you attach them to.

You can create static widget by calling createStaticWidget method on embedder:

ts
const widget = embedder.createStaticWidget({
    container: document.querySelector('#points-in-play-widget'),
    clientId: 1,
    locale: 'en',
    async tokenCallback() {
        return { status: 'notLoggedIn' };
    },
    loginCallback() {},
});

Floating widget

Floating widget is attched to the document body. Both toggler and content is positioned absolutely and they don't affect layout on your page.

You can create floating widget by calling createFloatingWidget method on embedder:

ts
const widget = embedder.createFloatingWidget({
    clientId: 1,
    locale: 'en',
    async tokenCallback() {
        return { status: 'notLoggedIn' };
    },
    loginCallback() {},
});

Options details

After you decide which widget you want to use you can head out to the next page to find out more about options you have to pass.