JS-React
ONEpocket React SDK
React Provider and Hooks for integrating the ONEpocket embedded wallet (formerly CROSSx) into React applications.
Current version:
@nexus-cross/crossx-sdk-reactv2.4.0
If you use wagmi, see
@nexus-cross/crossx-sdk-wagmiinstead.
This package is for React apps that don't use wagmi.
What you can do
- Wrap your app with
CROSSxProviderfor automatic session management - Use
useAuthhook for sign-in / sign-out / auth state - Use
useWallethook for address, signing, and transactions - Use
useCROSSxhook for direct SDK access and reactive state (advanced)
Quick start path
- Getting Started
Install packages and set upCROSSxProvider. - Authentication
Implement login/logout withuseAuth. - Wallet
Integrate wallet features withuseWalletanduseCROSSx. - EIP-1193 Provider
Use with ethers.js and viem inside React components. - API Reference
Check full hook signatures and return types.
Minimum integration example
import { CROSSxProvider } from '@nexus-cross/crossx-sdk-react'
ReactDOM.createRoot(document.getElementById('root')!).render(
<CROSSxProvider config={{ projectId: 'YOUR_PROJECT_ID' }}>
<App />
</CROSSxProvider>
)Notes
CROSSxProvidercallssdk.initialize()automatically on mount.- All hooks must be used within
CROSSxProvider. ONEpocketProvider/useONEpocketare rebrand aliases ofCROSSxProvider/useCROSSx— see API Reference.- For wagmi-based projects, use
@nexus-cross/crossx-sdk-wagmiinstead.
Updated 2 days ago