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
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