Welcome to the GoodDollar SDKs, a comprehensive collection of libraries and tools designed to integrate the GoodDollar Protocol into your applications. This monorepo provides everything you need to work with GoodDollar's Identity verification and Universal Basic Income (UBI) claiming systems.
GoodDollar is a protocol that aims to reduce wealth inequality through blockchain technology by providing Universal Basic Income (UBI) to verified users. The protocol uses identity verification to ensure fair distribution of G$ tokens.
The GoodSDK's Monorepo is structured to facilitate seamless development, testing, and deployment of identity-related functionalities across various applications. By centralizing shared packages and utilities, it ensures consistency and reusability, reducing redundancy and enhancing maintainability.
- Packages: Reusable libraries and SDKs that provide core functionalities.
- Applications: Frontend and backend applications that utilize the packages to deliver complete solutions.
The Identity SDK provides tools for managing user identity verification and whitelist status. It's the foundation for all GoodDollar integrations.
Key Features:
- โ Identity verification and whitelist management
- โ Face verification link generation
- โ Identity expiry tracking
- โ Support for both Wagmi (React) and Viem (backend) integrations
Use Cases:
- Verify user identity before allowing UBI claims
- Check whitelist status for access control
- Generate face verification links for new users
The Claim SDK is part of the same @goodsdks/citizen-sdk
package and handles Universal Basic Income (UBI) claiming functionality. It works in conjunction with the Identity SDK to ensure only verified users can claim their daily UBI.
Key Features:
- โ Daily UBI claiming with automatic balance checks
- โ Entitlement verification
- โ Next claim time tracking
- โ Daily statistics
Use Cases:
- Allow verified users to claim their daily UBI
- Show users when they can next claim
- Display claiming statistics
The GoodDollar SDK implements a sophisticated claim flow that ensures fair and secure UBI distribution:
-
๐ Verify Button - When user is NOT whitelisted
- User needs to complete identity verification
- Shows "Verify Me" button
- Redirects to face verification process
-
โฐ Timer State - When user is whitelisted but already claimed
- User has already claimed UBI for the current period
- Shows countdown to next claim time
- Displays "Come back tomorrow to claim your UBI!"
-
๐ฐ Claim Button - When user is whitelisted and can claim
- User is verified and eligible for UBI
- Shows claimable amount
- Displays "Claim UBI [amount]" button
For complete implementation details and code examples, see our Claim Flow Implementation Guide.
npm install @goodsdks/citizen-sdk
# or
yarn add @goodsdks/citizen-sdk
import { useIdentitySDK, useClaimSDK } from '@goodsdks/citizen-sdk';
function App() {
const identitySDK = useIdentitySDK('production');
const claimSDK = useClaimSDK('production');
// Check if user is whitelisted
const checkWhitelist = async (address: string) => {
const { isWhitelisted } = await identitySDK.getWhitelistedRoot(address);
return isWhitelisted;
};
// Claim UBI
const claimUBI = async () => {
const receipt = await claimSDK.claim();
console.log('UBI claimed!', receipt);
};
return (
<div>
{/* Your UI components */}
</div>
);
}
- Identity SDK Documentation - Complete guide to identity verification
- Claim SDK Documentation - UBI claiming implementation details and claim flow examples
- Demo Application - Live example implementation
- Identity Demo App - See the SDK in action
- Source Code - Complete implementation example
- Node.js >= 18
- Yarn package manager
# Clone the repository
git clone https://github.com/GoodDollar/GoodSDKs.git
cd GoodSDKs
# Install dependencies
yarn install --immutable
# Build all packages
yarn build
# Start development server
cd apps/demo-identity-app
yarn dev
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork and clone the repository
- Create a feature branch for your work
- Make your changes following the existing patterns
- Test thoroughly using the demo applications
- Submit a pull request with clear descriptions
We offer rewards for contributions through our Scoutgame Program. Look for issues labeled with scoutgame
to get started!
- Discord - Join our developer community
- Documentation - Official GoodDollar docs
- GoodBuilders Program - Build on GoodDollar
This project is licensed under the MIT License. See the LICENSE file for details.