Integrations

Embed widget

Drop your Bynli group into any website with one <script> tag. No iframes, no CSS conflicts — the widget renders in Shadow DOM so your site's styles stay put.

Quick start

Paste this anywhere on your page — usually right before </body>:

HTMLyour site
<script
  src="https://bynli.com/widget.v2.js"
  data-key="bapi_tk_your_key_here"
  async></script>

The widget adds a small floating card in the corner of your site showing your group name, a live stat (members, campaign progress, next event), and a primary action button. Clicking it opens a contained side drawer (desktop) or bottom sheet (mobile) with everything else.

Two versions are live. widget.v2.js is the current widget — floating card + drawer, with auto-derived primary action. widget.js is the original — bubble + full-screen overlay, still maintained, still supported. Existing embeds keep working; new embeds should use v2.js.

Get your key

  1. Go to /dash/integrations/api-tokens.
  2. Click Create a token.
  3. Give it a label like "Website embed".
  4. Check embed:widget in the scopes list. This is the only scope the widget needs.
  5. Optionally list the domains allowed to use it (recommended — see below).
  6. Click create. Copy the bapi_tk_… value immediately — it's shown once.
Already have a token? You can add embed:widget to an existing token from the same page — click Edit, check the scope, save. No need to rotate or recreate.

Domain locking

The first time the widget loads on a new domain, that domain is auto-registered to your group and we email your admins. Requests from any other domain are rejected — so a copy of your embed snippet on someone else's site won't work.

If you need to move embeds to a new domain (site migration, etc.), visit your widget settings on the dashboard to update the registered domain.

Customize

Pass options as extra data- attributes on the script tag:

AttributeValuesPurpose
data-key required Your API token with the embed:widget scope.
data-mode float (default)
inline
How the widget appears. See Inline mode below.
data-position bottom-right (default)
bottom-left
Where the floating card sits. Float mode only.
data-accent Any CSS color (e.g. #7a4cc3) Override your group's accent color for this embed.
data-target Element id (e.g. my-widget) Required for data-mode="inline". The widget mounts inside the element with this id.

Inline mode

Inline mode renders the widget directly into a section of your page — no floating trigger, no overlay. Often converts better when the widget is the page's main content (e.g. a donate landing page or a community sign-up section).

HTMLyour site
<div id="my-widget"></div>

<script
  src="https://bynli.com/widget.v2.js"
  data-key="bapi_tk_your_key_here"
  data-mode="inline"
  data-target="my-widget"
  async></script>

Same hero card and section composition as the drawer — just rendered in document flow. The widget keeps its dark surface treatment; it doesn't inherit your host page's typography or colors.

Deep linking

Link directly to a part of the widget from anywhere on your page using URL hashes:

HashOpens to
#bynli-openThe widget drawer (default tab)
#bynli-donateDonate hero
#bynli-eventsEvents section
#bynli-feedLatest posts
#bynli-resourcesResources
#bynli-joinJoin / become-a-member
HTMLyour site
<a href="#bynli-donate">Support our work</a>

What's inside

The widget mirrors the section ordering you configured on your public group page at bynli.com/group/<slug>. You don't maintain a separate config for the widget — change the order or visibility of sections on your group page and the widget follows.

The primary action is auto-picked based on your group's setup:

Accessibility

Troubleshooting

Widget doesn't appear at all

Open your browser's developer console (F12). Look for messages prefixed with [Bynli] or [Bynli v2].

Donate button leads to the wrong group

If a logged-in visitor clicks Donate and lands on their own group's checkout instead of yours, you're on an older version of the widget — update to widget.v2.js (or the latest widget.js).

Team logo broken / wrong URL

The widget always loads images from bynli.com regardless of where it's embedded. If your logo shows a broken-image icon, the URL stored on your group page is probably wrong. Re-upload the logo from your group settings.

Open it programmatically

The deep-link hashes work programmatically too — just set location.hash:

JavaScriptyour site
document.getElementById('donate-btn')
    .addEventListener('click', () => {
        location.hash = 'bynli-donate';
    });