ismail-codinglab/gmail-inbox

[Help] How to use 2 different Gmail account in one project?

Closed this issue · 3 comments

In my project, I use different users for different environments. There is any way to use 2 different gmail-token?
I am thinking about copy proper file according to the environment but I am not sure if it is the best solution

Extra question
What is the default value of these parameters?

  • timeTillNextCallInSeconds
  • maxWaitTimeInSeconds?

Question 1

Yes!

https://github.com/ismail-codinglab/gmail-inbox/blob/master/src/Inbox.ts

Inbox class accepts 2 parameters

constructor(private credentialsJsonPath: string, private tokenPath = 'gmail-token.json') {}

You can do

let inbox1 = new Inbox('inbox1-secret.json','inbox1-token.json');
let inbox2 = new Inbox('inbox2-secret.json','inbox2-token.json');

Question 2

gmail-inbox/src/Inbox.ts

Lines 151 to 152 in aa71619

timeTillNextCallInSeconds: number = 5,
maxWaitTimeInSeconds: number = 60,

they are 5 and 60 respectively

If this answers your question let me know n you can close it

Thank you for your answer.