Skip to Content
Anuma SDKReactHooksuseGoogleDriveAuth

useGoogleDriveAuth

useGoogleDriveAuth(): GoogleDriveAuthContextValue

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

Hook to access Google Drive authentication state and methods.

Must be used within a GoogleDriveAuthProvider.

Returns

GoogleDriveAuthContextValue

Example

import { useGoogleDriveAuth } from "@anuma/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