Problem with JSForce

I am trying to access the REST API using JSForce. I am connecting fine via OAuth, signing in and being redirected to where I need to be with my access token, etc. After that I am trying to access the data. Problem is, the console is showing nothing back to me… Which means that the jsforce.browser.on function is not working. See below:

jsforce.browser.init({
                 clientId: 'Works',
                 redirectUri: 'Works'
                 });

jsforce.browser.on('connect', function(conn)
               {
               conn.query('-----', function(err, res)
                          {
                          if (err)
                          {
                            return console.error(err);
                          }
                          console.log(res);
                          console.log("Console");
                          });
               });

This code is supposed to work. Has anybody experienced this problem before? Any idea what is going on here?

I’m unfamiliar with jsforce but there’s no noticeable errors in the code.

Does the example on the homepage work for you?

That code works for me, but I am getting a client ID error. That way also hard codes the login and password and that’s not something that I am looking to do.

The code I posted is from the ‘Web Browser’ portion of their website. I am totally lost on why it would not be working.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.