I have created a chrome plugin to fetch the list of user, I am using Octokit
chrome.runtime.onMessage.addListener(getDataFromPopup);
function getDataFromPopup(message){
const apiUrl = message.apiUrl;
const apiToken = message.apiToken;
console.log('apiToken -> '+apiToken);
console.log('apiUrl -> '+apiUrl);
const objOctokit = new Octokit({
auth: 'token '+apiToken,
// set custom URL for on-premise GitHub Enterprise installations
baseUrl: apiUrl,
request: {
timeout: 0
}
});
objOctokit.users.list().then(function (objResult) {
debugger;
alert(objResult);
});
chrome.runtime.onMessage.removeListener(getDataFromPopup); //optional
}
I am giving the token from the developer settings and the url as https://api.github.com
but the return is a list of 30 users which I dont even know.
Am in using Octokit
correctly?
Expected : Only my User details.
Actual : List of 30 random users. As shown in image .