📁 How to Connect Google Drive (One-Time Setup)
Once set up, you can pick your own photos & videos directly from Drive into any post — no copyright worries since you own the content!
Step 1 — Create a Google Cloud Project (Free)
1. Go to console.cloud.google.com and sign in with your Google account
2. Click Select a project → New Project → name it "Door Sanchar" → Create
3. In the left menu → APIs & Services → Library
Step 2 — Enable Required APIs
Search for and enable both of these:
• Google Drive API → Enable
• Google Picker API → Enable
Step 3 — Create API Key
1. APIs & Services → Credentials → Create Credentials → API Key
2. Copy the key (looks like: AIzaSy...)
3. Click Restrict Key → under API restrictions, select Google Drive API and Google Picker API
4. Under Application restrictions → add your domain (e.g. doorsanchar.in)
Step 4 — Create OAuth 2.0 Client ID
1. Credentials → Create Credentials → OAuth client ID
2. Application type: Web application
3. Authorized JavaScript origins: add https://www.doorsanchar.in (and http://localhost:3000 for testing)
4. Copy the Client ID (looks like: 1234567890-abc...apps.googleusercontent.com)
Step 5 — Add Your Keys to the Code
Open index1.html and find these two lines near the bottom (in the script section):
const DRIVE_API_KEY = 'YOUR_API_KEY_HERE';
const DRIVE_CLIENT_ID = 'YOUR_CLIENT_ID_HERE';
Replace the placeholder values with your actual keys. Save the file and deploy to Vercel.
Step 6 — Make Drive Files Public Before Using
When you upload a photo/video to Drive:
1. Right-click the file → Share
2. Change access to "Anyone with the link" → Viewer
3. Click Done
Now when you use the Drive picker in Write Post, the image/video will load for all your readers! 🎉
✅ Benefits of Using Google Drive
• Your own photos = zero copyright issues
• Free storage — 15 GB with Google account (upgrade for more)
• Original content = better Google AdSense approval chances
• Videos play directly on your site without YouTube
• Files are reliably hosted on Google's servers