1.2.2 • Published 17 days ago
@sophon-labs/account-react v1.2.2
@sophon-labs/account-react
React components and hooks for integrating Sophon Account into React applications.
Features
- React context provider for Sophon Account
- Custom hooks for wallet and authentication state
- UI components for wallet connection and user profile
- Formatters and utilities for common operations
Installation
npm install @sophon-labs/account-react
# or
yarn add @sophon-labs/account-react
Usage
import { SophonContextProvider } from '@sophon-labs/account-react';
function App() {
return (
<SophonContextProvider partnerId="YOUR_PARTNER_ID">
<YourApp />
</SophonContextProvider>
);
}
Components
Context Provider
SophonContextProvider
: Main provider component for Sophon Account integration
UI Components
SophonConnectButton
: Button component for wallet connectionSophonUserProfile
: Component for displaying user profile informationSophonWidget
: Embedded wallet widget component
Hooks
useSophonContext
: Access Sophon Account contextuseRefreshUser
: Refresh user datauseReinitialize
: Reinitialize the wallet connectionuseIsLoggedIn
: Check if user is logged inuseSophonEvents
: Access Sophon event handlers
Utilities
shortenAddress
: Format Ethereum addresses for displaygetStorageAuthToken
: Get authentication token from storage
Dependencies
- React (>=19.1.0)
- viem (>=2.26.0)
- @sophon-labs/account-core
- @dynamic-labs/sdk-react-core
1.2.2
17 days ago
1.2.1
23 days ago
1.1.24
24 days ago
1.1.23
24 days ago
1.1.22
24 days ago
1.1.21
24 days ago
1.1.20
24 days ago
1.1.19
24 days ago
1.1.18
24 days ago
1.1.17
25 days ago
1.1.16
27 days ago
1.1.15
27 days ago
1.1.14
27 days ago
1.1.13
29 days ago
1.1.12
1 month ago
1.1.11
1 month ago
1.1.10
1 month ago
1.1.9
2 months ago
1.1.8
2 months ago
1.1.7
2 months ago
1.1.6
2 months ago
1.1.5
2 months ago
1.1.4
2 months ago
1.1.3
2 months ago
1.1.2
2 months ago
1.1.1
2 months ago
2.0.0
2 months ago