Skip to Content
SdkReactHooksuseGoogleDriveAuth

useGoogleDriveAuth

useGoogleDriveAuth(): GoogleDriveAuthContextValue

Defined in: src/react/useGoogleDriveAuth.ts:234 

Hook to access Google Drive authentication state and methods.

Must be used within a GoogleDriveAuthProvider.

Returns

GoogleDriveAuthContextValue

Example

import { useGoogleDriveAuth } from "@reverbia/sdk/react"; function GoogleDriveButton() { const { isAuthenticated, isConfigured, requestAccess, logout } = useGoogleDriveAuth(); if (!isConfigured) { return <p>Google Drive not configured</p>; } if (isAuthenticated) { return <button onClick={logout}>Disconnect Google Drive</button>; } return <button onClick={requestAccess}>Connect Google Drive</button>; }
Last updated on