Quick Start
Overview
This guide is designed to help you quickly integrate Byzanlink's Account Abstraction and Auth SDKs in your React app.
Integration
Create a new react app
Navigate to project directory
Install the Byzanlink AA SDK
Install required dependencies
Additional packages to use Signer instead of Private key. Refer step 8 for more information
Create the following tsconfig.json (Typescript config)
Additional steps to handle Webpack issue
Install
craco
into your application
Install missing libraries
Create
craco.config.ts
in the root of your project folder with the content:
Replace the scripts in package.json to use craco instead of react-scripts
Replace the content of App.tsx with the following
Following values are required before running the code
REACT_APP_POLICY_ID
Policy ID of the Gas Manager available under Services in Byzanlink dashboard
REACT_APP_WEB3AUTH_NETWORK
Network selected for a project under Wallet Infra
REACT_APP_WEB3AUTH_VERIFIER
Verifier name of Custom Authentication for a project under Wallet Infra
REACT_APP_WEB3AUTH_SUB_VERIFIER
Sub-verifier name of Custom Authentication for a project under Wallet Infra
App.tsx
token
JWT token of the user for which the smart account needs to be fetched
Start the react app
Update the values for the keys mentioned in step 6 and click on Connect. You should be able to see the wallet address along with balance.
Congrats! You just created your Smart Wallet Account with Byzanlink.
Now, take a moment to explore the Smart Account documentation and discover all the other features and capabilities that our SDK offers.
In case of any issues, please check the browser console for more information or follow the troubleshooting guide mentioned below
Troubleshooting
Fixing Bundler Issues
While using Byzanlink Auth in React, you may run into issues building. This issue occurs because some core packages like eccrypto
have certain dependencies which are not present within the browser build environment.
To solve this, please have a look at our troubleshooting pages:
Last updated