JS-React
CROSSx React SDK
React Provider and Hooks for integrating CROSSx embedded wallet into React applications.
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 up
CROSSxProvider. - Authentication
Implement login/logout with
useAuth. - Wallet
Integrate wallet features with
useWalletanduseCROSSx. - 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. - For wagmi-based projects, use
@nexus-cross/crossx-sdk-wagmiinstead.
Updated 15 days ago