Getting Started with Wallet SDK
This guide will walk you through the process of setting up and using the Wallet SDK in your project. We'll cover merchant registration, SDK installation, and basic configuration.
Prerequisites
Before you begin, ensure you have:
- Node.js (version 16 or later) installed
- A modern web browser
- Basic knowledge of JavaScript/TypeScript and your chosen framework (React or vanilla JS)
1. Register Your Merchant
Before using the Wallet SDK, you need a merchant account on the Frak Business Platform:
- Visit https://business.frak.id/
- Sign up or log in to your account — your main storefront domain is registered automatically at sign-up.
- (Optional) If your site lives on a subdomain different from the registered main domain, add it under Allowed Domains on the dashboard.
For a detailed walkthrough, see our Business Registration Guide.
2. Setup the Frak SDK
Integration Options
The Wallet SDK offers flexible integration options to suit different development environments:
-
React Integration Learn how to integrate the Wallet SDK into your React applications using our custom hooks and providers.
-
JS Package Manager Discover how to use the Wallet SDK in a JavaScript / TypeScript environment with a package manager (npm, yarn, bun).
-
CDN / Browser Integration Discover how to use the Wallet SDK in a vanilla JavaScript environment without any package manager.
Integration guide
Here is a few guide to implement this SDK in some popular frameworks:
-
Shopify How to use the Component SDK within a Shopify environment, and how to link Shopify events to it.
-
WordPress (with WooCommerce) How to use the Component SDK within a WordPress environment, and how to link WooCommerce events to it.
Key Implementation Steps
Regardless of your chosen integration method, here are the key steps you'll typically follow when implementing the Wallet SDK:
-
SDK Installation: Install the Wallet SDK package in your project.
-
Configuration: Set up the SDK configuration with your application's details
-
Client Initialization: Initialize the Frak client to establish communication with the Frak Wallet.
-
Interaction Tracking: Implement interaction tracking for user actions in your application.
-
Session Management: Handle delegated sessions for gasless interactions.
-
Rewards Integration: Set up reward systems or campaigns based on user interactions.
Best Practices
As you integrate the Wallet SDK, keep these best practices in mind:
- Always use environment-specific configurations (development vs. production).
- Implement proper error handling and provide meaningful feedback to users.
- Regularly check for SDK updates and keep your integration up-to-date.
Next Steps
Choose your preferred integration method from the options above and dive into the specific guide. Each guide will provide detailed, step-by-step instructions on how to integrate and use the Wallet SDK in your chosen environment.
Remember, the power of the Wallet SDK lies in its ability to seamlessly track and reward user interactions. As you become more familiar with the SDK, explore the advanced topics to learn how to implement more complex features and optimize your integration.
Happy coding with the Wallet SDK!