DEV Community

Phil Cajurao
Phil Cajurao

Posted on

React and Google Drive API

Hi guys, is it possible to integrate my React app to Google Drive API just in client side?

My task is to convert the forms that are answered by users from our site to PDF then upload it to our company's Google Drive.

Top comments (1)

Collapse
 
scsoi profile image
疏影 •

React + Drive API is the canonical web-side pattern. The companion question for Windows desktop users is 'can I just open Drive files from Explorer without writing an integration?'. Two patterns we use:

  • For the design / non-engineer team, the Google Drive desktop sync client works but breaks on shared drives and large folders. Mounting the Drive (via Drive File Stream / a WebDAV-style mount) as a drive letter gives Explorer-as-native access. ScsDriver doesn't talk to Google Drive directly but the pattern is the same: any backend that exposes WebDAV / S3-compatible / SMB can be mounted and the file just shows up in Explorer.
  • For a true cloud-agnostic stack, point the React app at an S3-compatible bucket (R2 / Spaces / B2) instead of Drive — same Drive API surface for the user, much cheaper egress, and the Windows team gets a drive letter via ScsDriver.

Couple of operational notes from running React + Drive API:

  • The OAuth refresh dance is the part that breaks first; design the React app so a 401 triggers a clean re-auth, not a 5xx.
  • For multi-file uploads, use the resumable upload endpoint; the simple multipart endpoint will silently fail on >5MB files on a flaky network.
  • If the user is going to also access the same files via a Windows desktop, plan that mount path up front — having both a Drive-API app AND a Drive mount client on the same machine is fine but documenting the path-resolution behavior saves tickets. Nice writeup.