Login

Login Hooks

The hooks provide authentication methods for VeChain applications:

Authentication Hooks

  • useLoginWithPasskey: Hook for authenticating using passkeys (biometric/device-based authentication)

  • useLoginWithOAuth: Hook for authenticating using OAuth providers (Google, Twitter, Apple, Discord)

  • useLoginWithVeChain: Hook for authenticating using VeChain wallet

Types

// OAuth Types
type OAuthProvider = 'google' | 'twitter' | 'apple' | 'discord';

interface OAuthOptions {
    provider: OAuthProvider;
}

interface UseLoginWithOAuthReturn {
    initOAuth: (options: OAuthOptions) => Promise<void>;
}

interface UseLoginWithPasskeyReturn {
    loginWithPasskey: () => Promise<void>;
}

interface UseLoginWithVeChainReturn {
    login: () => Promise<void>;
}

Usage example

Was this helpful?