How to use the intuit-oauth.environment function in intuit-oauth

To help you get started, we’ve selected a few intuit-oauth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intuit / oauth-jsclient / sample / app.js View on Github external
app.get('/getCompanyInfo', function(req,res){


    const companyID = oauthClient.getToken().realmId;

    const url = oauthClient.environment == 'sandbox' ? OAuthClient.environment.sandbox : OAuthClient.environment.production ;

    oauthClient.makeApiCall({url: url + 'v3/company/' + companyID +'/companyinfo/' + companyID})
        .then(function(authResponse){
            console.log("The response for API call is :"+JSON.stringify(authResponse));
            res.send(JSON.parse(authResponse.text()));
        })
        .catch(function(e) {
            console.error(e);
        });
});

intuit-oauth

Intuit Node.js client for OAuth2.0 and OpenIDConnect

Apache-2.0
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis

Popular intuit-oauth functions