Example Scenarios

Logging In a User

To log in a user, you can use the login method from the useRaydiushook:

import React from 'react'
import { useRaydius } from '@raydius/react'

export default function LoginComponent() {
  const { login } = useRaydius()

  return (
    <button onClick={login}>Login</button>
  )
}

Logging Out a User

To log out a user, you can use the logout method from the useRaydius hook:

import React from 'react'
import { useRaydius} from '@raydius/react'

export default function LogoutComponent() {
  const { logout } = useRaydius()

  return (
    <button onClick={logout}>Logout</button>
  )
}

Linking a Wallet

To link an additional wallet to a user's account, you can use the linkWallet method from the useRaydius hook:

import React from 'react'
import { useRaydius} from '@raydius/react'

export default function LinkWalletComponent() {
  const { linkWallet } = useRaydius()

  return (
    <button onClick={linkWallet}>Link Wallet</button>
  )
}

Last updated