1.2.0 • Published 1 year ago

minecraft-login v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago
const {
   authenticate
} = require('minecraft-login');

(async () => {
   try {
      const auth = await authenticate();
      console.log(`Visit ${auth.verificationUrl} and enter the code ${auth.userCode}`);

      // Wait for the user to complete the authentication and finish the flow
      const data = await auth.onComplete();
      console.log('Authentication successful:', data);
   } catch (error) {
      console.error('Authentication failed:', error.message);
   }
})();