Some popular APIs, like some of Google’s, use credential files. These are a pain to deal with.
We should support uploading these in the new environment variables panel in the dashboard.
Convert the file to base64 (on a Mac in terminal):
base64 path/to/your/service-account-file.jsonThen you'd set it as an env var on our side: https://trigger.dev/docs/deploy-environment-variables
Then inside your Trigger.dev code:
const credentials = JSON.parse(Buffer.from(process.env.GOOGLE_CREDENTIALS_BASE64, 'base64').toString('utf8'));
const { google } = require('googleapis');
const auth = new google.auth.GoogleAuth({
credentials,
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
const client = await auth.getClient();In Review
💡 Feature Request
Over 1 year ago

mattaitken
Get notified by email when there are changes.
In Review
💡 Feature Request
Over 1 year ago

mattaitken
Get notified by email when there are changes.