{"id":14978539,"url":"https://github.com/makis-san/electron-mc-auth","last_synced_at":"2025-10-28T11:30:26.749Z","repository":{"id":37632671,"uuid":"506054742","full_name":"makis-san/electron-mc-auth","owner":"makis-san","description":"Display an electronJs window to authenticate Minecraft accounts through Xbox Live.","archived":false,"fork":false,"pushed_at":"2022-12-23T17:43:33.000Z","size":156,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T14:14:01.131Z","etag":null,"topics":["auth","authentication","electronjs","mclc","microsoft","minecraft","oauth","xbox","xbox-live","xbox-live-oauth"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makis-san.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"makis-san","ko_fi":"makisz"}},"created_at":"2022-06-22T01:15:30.000Z","updated_at":"2023-05-16T03:30:09.000Z","dependencies_parsed_at":"2023-01-30T19:15:37.509Z","dependency_job_id":null,"html_url":"https://github.com/makis-san/electron-mc-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makis-san%2Felectron-mc-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makis-san%2Felectron-mc-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makis-san%2Felectron-mc-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makis-san%2Felectron-mc-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makis-san","download_url":"https://codeload.github.com/makis-san/electron-mc-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238638189,"owners_count":19505557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","authentication","electronjs","mclc","microsoft","minecraft","oauth","xbox","xbox-live","xbox-live-oauth"],"created_at":"2024-09-24T13:57:52.329Z","updated_at":"2025-10-28T11:30:26.186Z","avatar_url":"https://github.com/makis-san.png","language":"TypeScript","funding_links":["https://github.com/sponsors/makis-san","https://ko-fi.com/makisz","https://ko-fi.com/F1F63DAEF"],"categories":[],"sub_categories":[],"readme":"# electron-mc-auth\n\n\u003cdiv  align=\"center\"\u003e\nDisplay an electronJs window to authenticate Minecraft accounts through Xbox Live.\n\n---\n\n\u003cdiv  style=\"display:flex;justify-content:center;text-align: center; margin-top:1.25rem;\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/electron-mc-auth\" targe=\"_BLANK\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/electron-mc-auth?style=for-the-badge\" alt=\"version\"/\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/makis-san/electron-mc-auth?style=for-the-badge\" alt=\"license\"/\u003e\n  \u003ca href=\"https://ko-fi.com/F1F63DAEF\" targe=\"_BLANK\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white\" alt=\"ko-fi\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e \n  \n***\n  \n[Getting started](#getting-started) | [MCLC](#mclc) | [Contribuittions](/#)\n\n\u003c/div\u003e\n\n# Getting started\n\nStart by installing the package with your preffered package manager for node.\n\n```shell\nyarn add electron-mc-auth\n\nor\n\nnpm install electron-mc-auth\n```\n\n## Setup\n\nFirst of all, prefer to run the package code on the back-end side of the electron. So the documentation will only refer directly to the main.ts file.\n\n### useMcuseMcAuth()\n\nTo use the package authentication system, you need to instatiate the Auth function.\n\n```ts\nimport { Auth } from 'electron-mc-auth'\n\nconst mcAuth = useMcuseMcAuth()\n```\n\nThis function should return an object containing all package functions with the predefined configuration passed on it initialization.\n\nThere are some functions that you can import directly, but, to start the auth flow, you should use launch() function that is returned by the useMcuseMcAuth() function.\n\n### Starting the auth flow\n\nIt's pretty straightfoward, just use the launch() function provided by the useMcuseMcAuth() function and it will handle the Window creation and network requests to get you authenticated and reuturn the MinecraftProfile object.\n\nHere's an example on the main file of electron.\n\n```ts\n// /main.ts\n\napp.whenReady().then(() =\u003e {\n  createWindow()\n  const authenticate = async () =\u003e {\n    const { launch, refresh } = useMcAuth({...})\n    const auth = await launch()\n\n    if (!auth) return\n\n    const refreshData = await refresh(auth)\n\n    if (!refresh) return\n\n    dialog.showMessageBox({\n      message: `\n      Logged as: ${auth.name}\n    `\n    })\n\n    return true\n  }\n  authenticate()\n})\n```\n\n## The Minecraft profile object\n\nThis is the most important part of the package.\n\nIf the login is succesful, you should recieve an object like this;\n\n```ts\nexport interface MinecraftProfileTypes {\n  id: string\n  name: string\n  skins: {\n    id: string\n    state: string\n    url: string\n    variant: string\n  }[]\n  capes: {\n    id: string\n    state: string\n    url: string\n    alias: string\n  }[]\n  access_token: string\n  refresh_token: string\n  client_token: string\n  expires_in: number\n}\n```\n\n### MCLC\n\nAlso, the package can convert its object to be compatible with [MCLC](https://www.npmjs.com/package/minecraft-launcher-core) package.\n\nTo do this, just pass your Minecraft Profile object to the `getMCLC()` function.\n\n```ts\nfunction getMCLC(profile: MinecraftProfileTypes): MCLCAuthTypes\n```\n\n## Logging\n\nYou can pass your preffered callback for `onError`, `onInfo`, `onWarn`, `onLog` events\n\nExample using default `useMcAuth()` function.\n\n```ts\nconst { launch, getLink, login, getMCLC, refresh, validate, getMinecraft } =\n  useMcAuth({\n    onError: (msg) =\u003e {\n      return msg\n    }\n  })\n```\n\nHere's the type definition for the callback;\n\n```ts\nexport type LogFunctionTypes = (message: string) =\u003e void\n\nexport interface LoggerCallBackTypes {\n  onError?: LogFunctionTypes\n  onInfo?: LogFunctionTypes\n  onWarn?: LogFunctionTypes\n  onLog?: LogFunctionTypes\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakis-san%2Felectron-mc-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakis-san%2Felectron-mc-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakis-san%2Felectron-mc-auth/lists"}