I'm creating a web app that is using Blockstack and I have some problems with the Javascript and understanding how to use Blockstack in the browser.
Whenever I try to get the Blockstack user's ID or username:
var bsId = blockstack.loadUserData(profile).username;
console.log(bsId);
I get this error:
Uncaught ReferenceError: profile is not defined
But when I run the code directly in the developer console it works fine and returns the username. I'm curious what I'm doing wrong and also this is my first time dealing with Blockstack.
This is a application using Blockstack, Express, and Heroku. I've looked up this error and have not found much and have read over the documentation for Blockstack.
var bsId = blockstack.loadUserData(profile).username;
console.log(bsId);
To return the Blockstack username or selected information.