Skip to content

@loontail/minecraft-kit / MojangSession

Type Alias: MojangSession

ts
type MojangSession = {
  microsoft: {
     clientId: AzureClientId;
     refreshToken: MicrosoftRefreshToken;
  };
  minecraft: {
     accessToken: string;
     expiresAt: number;
     skins: ReadonlyArray<MojangProfileSkin>;
     username: string;
     uuid: PlayerUuid;
     xuid: string;
  };
};

Defined in: src/types/auth.ts:128

Combined Microsoft + Minecraft session returned by kit.auth.authorizationCode.run and kit.auth.refresh.

The fields under minecraft are everything OnlineAuth needs plus the raw /minecraft/profile payload so callers do not have to re-fetch it for skin/cape UI. The fields under microsoft are needed only to refresh the session later — persist them to durable storage (encrypted) alongside the user's profile.

Properties

PropertyModifierTypeDescriptionDefined in
microsoftreadonly{ clientId: AzureClientId; refreshToken: MicrosoftRefreshToken; }-src/types/auth.ts:143
microsoft.clientIdreadonlyAzureClientIdAzure AD application id used to mint the session.src/types/auth.ts:147
microsoft.refreshTokenreadonlyMicrosoftRefreshTokenMicrosoft refresh token; used to obtain a fresh session without re-prompting.src/types/auth.ts:145
minecraftreadonly{ accessToken: string; expiresAt: number; skins: ReadonlyArray<MojangProfileSkin>; username: string; uuid: PlayerUuid; xuid: string; }-src/types/auth.ts:129
minecraft.accessTokenreadonlystringBearer token for api.minecraftservices.com and the game itself.src/types/auth.ts:135
minecraft.expiresAtreadonlynumberWall-clock ms timestamp when accessToken expires.src/types/auth.ts:137
minecraft.skinsreadonlyReadonlyArray<MojangProfileSkin>Every skin slot Mojang has issued for the user (active + inactive).src/types/auth.ts:141
minecraft.usernamereadonlystringPlayer display name.src/types/auth.ts:131
minecraft.uuidreadonlyPlayerUuidPlayer UUID, dashed (e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6).src/types/auth.ts:133
minecraft.xuidreadonlystringXbox User ID (XUID) as a numeric string.src/types/auth.ts:139

MIT License