Claim UBI (Web-components)
Last updated
Was this helpful?
Last updated
Was this helpful?
The claim-button
web component provides a simple and interactive way for users to claim Universal Basic Income (UBI) in the form of GoodDollars (G$) on supported blockchain networks (Celo and Fuse). It integrates with the GoodDollar ecosystem to manage wallet connections, eligibility checks, and token claims, offering a seamless experience for users within any web application.
The claim-button
enables users to:
Connect their cryptocurrency wallet (via Reown AppKit).
Check their eligibility to claim G$ tokens based on the GoodDollar protocol.
If this is a new user, they will be guided through our
Claim their UBI with a single click, handling all blockchain transactions.
View their G$ token balance.
See a countdown timer until their next claim if they’ve already claimed for the current period.
Switch between supported chains (Celo and Fuse) if entitlements are available on another network.
Make sure you register your wallet on . You want to register an dapp which integrates 'appkit'
You can integrate the claim-button
into your project in two ways:
Can be used in any website, for a quick setup:
Download the Script: Download the claim-button.global.js
file from the project releases or build it from the source.
Include in HTML: Add the script to your HTML file.
Add the Component: Use the <claim-button>
tag where you want it to appear.
Note:: see above example for the metadata configuration, for simplicity removed from below examples.
For projects with a modern JavaScript setup:
Install the Package: Add the @goodsdks/ui-components
package to your project.
Import the Component: Import it in your JavaScript or TypeScript file.
For use in HTML: Place the <claim-button>
tag in your template.
For use in React": Place the <claim-button>
tag in your render method.
Customize the claim-button
using these properties:
environment
: Defines the environment for contract interactions.
Values: "production"
, "staging"
, or "development"
.
Default: "development"
.
Example:
appkitConfig
: (Set via JavaScript property)
Provides configuration for wallet connection and custom branding in wallet dialogs.
Expected to be an object with at least projectId
and a metadata
object containing your app's details.
Example:
Note: appkitConfig
cannot be set as an HTML attribute; it must be set on the element as a property from JavaScript.
Try out the claim-button
in action using the interactive widget below. This sandbox environment lets you see how the component works in a live setting, making it easier to understand its behavior and integration.
Dependencies: The component uses @reown/appkit
for wallet connections, @goodsdks/citizen-sdk
for claim logic, viem
for blockchain interactions, and lit
for the reactive UI.
If you want to build your own widget, see Claim UBI (Viem/Wagmi)
Supported Chains: Works on Celo and Fuse networks.
Feedback: Displays loading states, success messages, errors, and a countdown timer as needed.