Skip to content

@loontail/minecraft-kit / UploadSkinInput

Type Alias: UploadSkinInput

ts
type UploadSkinInput = {
  accessToken: string;
  fileName?: string;
  signal?: AbortSignal;
  skin: Uint8Array;
  variant: SkinVariantInput;
};

Defined in: src/auth/profile-mutations.ts:163

Inputs to uploadSkin.

Example

ts
import { readFile } from "node:fs/promises";
import type { UploadSkinInput } from "@loontail/minecraft-kit";

const input: UploadSkinInput = {
  accessToken: session.minecraft.accessToken,
  skin: await readFile("./my-skin.png"),
  variant: "SLIM",
};

Properties

PropertyModifierTypeDescriptionDefined in
accessTokenreadonlystringMinecraft bearer (session.minecraft.accessToken).src/auth/profile-mutations.ts:165
fileName?readonlystringOptional filename part of the multipart entry. Defaults to "skin.png".src/auth/profile-mutations.ts:175
signal?readonlyAbortSignal-src/auth/profile-mutations.ts:176
skinreadonlyUint8ArrayRaw PNG bytes of the skin (64×64 or 64×32 pixels per Mojang's rules).src/auth/profile-mutations.ts:167
variantreadonlySkinVariantInputSkin model variant — "CLASSIC" for standard arms, "SLIM" for Alex, or "AUTO" to pick the variant by inspecting the PNG pixels (see detectSkinVariant).src/auth/profile-mutations.ts:173

MIT License