What is the recommended auth flow to store the grant_id?

I am using the Scheduler and Email APIs and will have my users authenticate using Google Sign-in, but I am not sure what would be the best auth flow for this.

Currently I am going for the following:

  1. User logs in through Google and provides calendar and email access.
  2. Token is provided and we exchange for the grant_id.
  3. Store the grant_id in the DB
  4. Use the stored grant_id for providing the scheduling interface and using it to send emails.

Is this an okay flow or does the Nylas team recommend a different approach?

Hello @alienator that should be fine, we use the email as the grant_id so while the grant is valid, you only need the email. Keeping it on the DB is fine as long as your API KEY is secured enough, as you need the combination of both to get access to the email and calendar.

1 Like

Thank you @Blag! I appreciate all the help.

1 Like