This is a playground
to test code. It runs a full Node.js
environment and already has all of npm
’s 1,000,000+ packages pre-installed, including @gooin/garmin-connect-cn
with all npm
packages installed. Try it out:
const { GarminConnect } = require('../dist/index');
// Has to be run in an async function to be able to use the await keyword
const main = async () => {
// Create a new Garmin Connect Client
const GCClient = new GarminConnect({
username: 'goooinn@icloud.com',
password: 'Yzt753951'
});
// export const GARMIN_USERNAME_DEFAULT = 'gooin@outlook.com';
// export const GARMIN_PASSWORD_DEFAULT = 'Garmin753951';
// export const GARMIN_GLOBAL_USERNAME_DEFAULT = 'goooinn@gmail.com';
// export const GARMIN_GLOBAL_PASSWORD_DEFAULT = ',UxZ5YxiKK#N*56';
// Uses credentials from garmin.config.json or uses supplied params
// await GCClient.login('goooinn@icloud.com', 'Yzt753951');
await GCClient.login();
// Get user info
const info = await GCClient.getUserInfo();
// Log info to make sure signin was successful
console.log(info);
};
// Run the code
main();
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.