cloud-social-wallet
v1.0.23
Published
Cloud social wallet for single click login
Downloads
93
Readme
Cloud Social Wallet Reactjs SDK
Usage:
npm install cloud-social-wallet
import {WalletProvider} from "cloud-social-wallet";
function App() {
return (
<WalletProvider config={{rpc: '', backend_url: '', prefix: 'loop'}}>
<WalletApp/>
</WalletProvider>
)
}
import {useWallet} from "cloud-social-wallet";
function WalletApp() {
const {address, logout, login} = useWallet()
return (
<>
{
address ? <>
<p>{address}</p>
<button onClick={logout}>Disconnect</p>
</> : <>
<button onClick={() => login('google')}>Google Login</button>
</>
}
</>
)
}