nextjs-gcp-storage
nextjs-gcp-storage copied to clipboard
Error with GCS not working on Vercel but working on Local?
I had tried various methods to set environmental variable (GCS credentials) but image upload to bucket is not working. But it works in local very well.
use this setting instead
const storage = new Storage({
projectId: process.env.GCP_PROJECT_ID,
credentials: {
type: 'service_account',
private_key: process.env.GCS_PRIVATE_KEY,
client_email: process.env.GCS_CLIENT_EMAIL,
client_id: process.env.GCS_CLIENT_ID,
universe_domain: process.env.GCS_UNIVERSE_DOMAIN,
},
});