I’m developing a browser-based puzzle game using HTML5 canvas and JavaScript. The game will be distributed through Chrome Web Store as an offline app. I want to implement cloud storage functionality so players can sync their progress and preferences across multiple devices.
My goal is to store player data (game progress, user settings, achievement records) in their Google Drive account. The data is just a simple JSON file, nothing complex. However, I’m struggling with Google’s authentication system and API documentation.
Can someone explain the easiest approach to read and write files to Google Drive using JavaScript? I’ve looked at the Drive API but the auth flow seems overly complicated for my basic needs.
Also wondering if there are alternative solutions - maybe using Google Sheets API or Firebase instead? Would server-side languages like Node.js or Python make this easier to implement?
Honestly, Google Sheets is probly your best option. The Sheets API is way simpler than Drive’s - just make a spreadsheet for each user and use it like a basic database. You’ll still need Google OAuth, but it’s less complicated since you’re only reading and writing cells. I used this for a mobile game prototype and it worked surprisingly well for small datasets.
Google Drive API authentication is a pain for simple projects. Had the same nightmare building a note-taking app last year. The OAuth2 flow needs multiple redirects and token juggling that breaks everything for users. Fought with Drive API for weeks before switching to Firebase Firestore - best decision ever. Authentication’s way easier - one-click Google sign-in, plus you get real-time sync built in. Free tier covers most indie games too. If you’re stuck on Google Drive, try a hybrid setup. Keep critical game data in Firebase for reliability, then add Google Drive export as optional backup. Users get smooth syncing but still control their files.
For Chrome Web Store apps, try Chrome’s built-in storage APIs first before jumping to Google Drive. The chrome.storage.sync API syncs user data across devices automatically - way simpler to implement. If you really need Google Drive, use the Google API client library to handle auth easier. Register your app in Google Cloud Console and use incremental authorization to make OAuth2 less painful. Firebase is another solid option for real-time syncing, though you’re still stuck with Google’s infrastructure.