Skip to Content
Hub widget

Hub widget

The widget is the simple ownership and analytics bridge. Creators paste one script into their site and Nibgate can verify the origin.

Snippet

Use the site id and token generated by the dashboard.

<script async src="https://www.nibgate.xyz/widget.js" data-nibgate-site="SITE_ID" data-nibgate-token="SITE_VERIFY_TOKEN" data-nibgate-api="https://api.nibgate.xyz"> </script>

What the widget does

  • Carries the data-nibgate-site marker the backend looks for when verifying the origin.
  • Sends page views and route activity.
  • Helps Nibgate detect whether the site is still connected.
  • Bridges browser-side content impressions into the hub.

The widget is intentionally easy to paste into any site engine: Next.js, static HTML, Webflow-style exports, Rails, Laravel, Express, or a custom stack.

The widget sends events to /hub/evt instead of /hub/track to avoid adblocker filter lists. The legacy /hub/track endpoint remains available.

What the widget does not do

The widget is not the payment brain. Gating, pricing, receiver config, unlock state, and server-trusted events belong in the package integration.

Hosted checkout and access enforcement

The widget can initiate hosted payments without a custom checkout handler. Hidden HTML is only a display gate: anything already embedded in the page can be read without paying. Keep paid bodies and files behind a server-verified access route. The markup below illustrates checkout UI, not secure content storage:

<div data-nibgate-premium="0.01" data-nibgate-recipient="0xYourWallet"> <p>Teaser visible to everyone...</p> <div data-nibgate-unlock-card> <span data-nibgate-wallet-label>No wallet</span> <button data-nibgate-connect>Connect</button> <button data-nibgate-unlock-btn>Unlock for 0.01 USDC</button> <p data-nibgate-status></p> </div> <div data-nibgate-unlocked hidden> <!-- Render paid content here only after a protected server request succeeds. --> </div> </div>

The widget detects data-nibgate-premium, calls POST /hub/pay on Nibgate’s server, and runs the x402 payment flow. Hosted-pay routing can resolve the recipient to a fee wallet contract; distribution applies the configured protocol split. A successful checkout does not protect content already present in public HTML.

Setup flow

Add the site in Nibgate

Register the origin from the dashboard.

Copy the widget script

Use the generated siteId and verification token.

Deploy your site

The script must be visible on the public domain you registered.

Verify ownership

Click verify in the dashboard. Nibgate crawls the origin and checks for the widget.

Last updated on