Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 966 Bytes

auth.oauth.md

File metadata and controls

29 lines (21 loc) · 966 Bytes

auth.oauth(credentials, token)

Authenticate Gootenberg with Google using OAuth. Create a credentials.json file by going to the applicable API and clicking the "Enable the API" button and then clicking "Download Client Configuration".

Then, create a token.json file by running the following from within your node project:

$ npx gootenberg token [ PATH/TO/credentials.json ]

Follow the instructions, and you should have a token.json file in your current working directory.

Example

import Gootenberg from 'gootenberg';
import credentials from './credentials.json'
import token from './token.json'

async function myFunc(){
  const goot = new Gootenberg();
  await goot.auth.oauth(credentials, token);
}

myFunc();