- Copy the private key to clipboard
- Run command
pbpaste | base64 | pbcopy
- The private key is now base64 encoded in the clipboard. Paste it to env variable e.g. to heroku or to .env file
const private_key = new Buffer(process.env.PRIVATE_KEY, 'base64').toString('ascii');
new Buffer
is deprecated. We should useBuffer.from(env.GOOGLE_CREDENTIALS, 'base64').toString('ascii')
instead.