Public Google Drive Folder Support
Fetch and paginate public folder contents using the official Google Drive API v3.
Overview
Dynamically load entire public folders using the useDriveFolder hook. Handles pagination, error states, and automatic media type detection.
Code Example
folder-support.tsx
| 1 | import { useDriveFolder } from '@driveloader/react'; |
| 2 | |
| 3 | const { assets, loading, loadMore } = useDriveFolder({ |
| 4 | folderUrl: 'https://drive.google.com/drive/folders/ID', |
| 5 | apiKey: 'YOUR_API_KEY', |
| 6 | }); |
Best Practices
- •Always restrict your Google Drive API Key to your production domain to prevent abuse.
Common Mistakes
- ×Forgetting to pass an apiKey. Folder loading is the ONLY feature in DriveLoader that requires an API key.
