Raydius Litepaper
  • Introduction
    • Overview
    • Mission & Vision
    • What is Raydius?
  • Core Concepts
    • Chain Abstraction
    • Raydius SDK
      • Social Login SDK
        • Raydius React SDK
          • Prerequisites
          • Installation
          • Get Your Raydius App ID
          • Set Up Your App with Raydius React SDK
          • Using the useRaydius Hook
          • Wallet Security
          • Setup
          • Advanced Usage with wagmi
          • Example Scenarios
        • Raydius Vue SDK
          • Prerequisites
          • Installation
          • Get Your Raydius App ID
          • Set Up Your App with Raydius Vue SDK
          • Using the useRaydius Hook
          • RaydiusVuePlugin Config
          • Wallet Security
      • User Loyalty Toolkit
      • Analytics Dashboard
    • Raydius Extension Store
    • Raydius Express
  • Technical Architecture
    • Tech Stack Overview
    • Multi-Chain Support
    • Security & Compliance
  • Getting Started
    • Setting Up Your Development Environment
    • Using the Raydius SDK
    • Creating and Managing Extensions
    • Integrating Raydius Express
  • Tokenomics
    • Overview of $RAYS
    • Token Utilities
    • Token Demand and Supply
  • Ecosystem and Community
    • Community Hub
    • Partnerships & Integrations
    • Developer & User Incentives
  • FAQs
    • General Questions
    • Technical Questions
    • Token-Related Questions
Powered by GitBook
On this page
  1. Core Concepts
  2. Raydius SDK
  3. Social Login SDK
  4. Raydius React SDK

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>
  )
}
PreviousAdvanced Usage with wagmiNextRaydius Vue SDK

Last updated 8 months ago