@web3-onboard/capsule
Wallet module for connecting Capsule Embedded Wallets to Web3-Onboard
Capsule is a signing solution that enables you to create secure embedded MPC wallets, allowing users to onboard with just an email or social login. Capsule wallets are recoverable, portable, and permissioned across different crypto applications, eliminating the need for users to create separate signers or contract accounts for each app.
Getting Started
- Visit the Capsule Developer Portal
- Create a new project
- Generate an API key for your project
- Configure your project settings and environments
Installation
npm install @web3-onboard/capsule
yarn add @web3-onboard/capsule
pnpm install @web3-onboard/capsule
bun add @web3-onboard/capsule
Configuration Options
export type CapsuleInitOptions = {
environment: Environment
apiKey: string
constructorOpts?: Partial<ConstructorOpts>
modalProps?: Partial<CapsuleModalProps>
walletIcon?: () => Promise<string>
walletLabel?: string
}
Implementation
import Onboard from '@web3-onboard/core'
import Capsule, { Environment } from '@usecapsule/react-sdk'
import capsuleModule from '@web3-onboard/capsule'
const capsule = new Capsule(
Environment.BETA,
'YOUR_API_KEY'
)
const capsuleWallet = capsuleModule(capsule)
const onboard = Onboard({
wallets: [
capsuleWallet
]
})
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
Additional Resources