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 /api/hub/track to avoid adblocker filter lists. The legacy /api/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 mode (zero backend code)

The widget can also handle payments for you — no SDK import or server access route needed:

<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> Full premium content here... </div> </div>

The widget detects data-nibgate-premium, calls POST /hub/pay on Nibgate’s server, and runs the x402 payment flow. Money goes directly to the creator’s wallet — Nibgate never touches the funds.

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