Search code examples
meteormeteor-accounts

Meteor.js accounts-google get clientId and secret


I'm using the accounts-google package for oAuth in my meteor app. I want to grab the clientId and secret (apparently stored in the meteor_accounts_loginServiceConfiguration mongo collection), but am unsure how to do so. Any help would be great! thanks.


Solution

  • You can use this code snippet :

    const googleServiceConfig = Accounts.loginServiceConfiguration.findOne({
      service: 'google',
    });
    console.log(googleServiceConfig.clientId, googleServiceConfig.secret);