# starlightskinapi

> Starlight SkinAPI Wrapper

Latest version **1.0.10** (published 2024-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install starlightskinapi
pnpm add starlightskinapi
yarn add starlightskinapi
bun add starlightskinapi
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2024-03-16 |
| First published | 2023-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 419.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Rincko Dev |
| Maintainers | rinckodev |
| Keywords | minecraft, skin, render, api, wrapper, starlightskinapi, starlight, skinapi |

## Links

- npm: https://www.npmjs.com/package/starlightskinapi
- Repository: https://github.com/rinckodev/starlightskinapi
- Homepage: https://github.com/rinckodev/starlightskinapi/#readme
- Issues: https://github.com/rinckodev/starlightskinapi/issues
- npm.io page: https://npm.io/package/starlightskinapi

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.10 (latest) — 2024-03-16
- 1.0.9 — 2024-03-13
- 1.0.8 — 2024-03-12
- 1.0.7 — 2024-03-05
- 1.0.6 — 2024-03-05
- 1.0.5 — 2023-11-22
- 1.0.4 — 2023-11-22
- 1.0.3 — 2023-11-22
- 1.0.2 — 2023-11-22
- 1.0.1 — 2023-11-22
- 1.0.0 — 2023-11-22

## README

# Starlight SkinAPI Wrapper
<p align="center">
    <img src="./assets/images/logo.png" width=450>
</p>

This package is a Starlight SkinAPI wrapper

Oficial Starlight SkinAPI Documentation : https://docs.lunareclipse.studio/

### Installation
```bash
npm install starlightskinapi
```

fetchSkinInfo function usage:
```ts
import { fetchSkinInfo } from "starlightskinapi";

async function main(){
    const playerNickname = "RinckoZ_";
    const infoResult = await fetchSkinInfo(playerNickname)

    if (infoResult.success){
        console.log(infoResult.playerUUID)
        console.log(infoResult.skinUrl)
        console.log(infoResult.userCape)
        console.log(infoResult.skinTextureWidth)
        console.log(infoResult.skinTextureHeight)
    }
}
main();
```
Output:
```bash
f169e30f110943dfba445da3b7dee1ce
http://textures.minecraft.net/texture/4d24cc4874ba673963ca57818a0be02666aa80f4747d00b45571e380ed9b54f7
http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933
64
64
```

If the nick or uuid is not found, success will be false, and you will have the error property
```ts
async function main(){
    const playerNickname = "NicknameVeryLongAndUnlikely";
    const infoResult = await fetchSkinInfo(playerNickname)

    if (!infoResult.success){
        console.log(infoResult.error)
    }
}
main();
```

Output: 
```bash
Unknown player username/uuid.
```

See how to get a render pose

```ts
import { RenderCrops, RenderTypes, fetchSkinRender } from "starlightskinapi";
import { writeFile } from "node:fs/promises"

async function main(){
    const playerNickname = "RinckoZ_";
    const renderResult = await fetchSkinRender(playerNickname, {
        type: RenderTypes.Default,
        crop: RenderCrops.Full,
    })

    if (!renderResult.success){
        console.log(renderResult.error)
        return;
    }

    if (renderResult.success){
        const { buffer, url } = renderResult;
        console.log(url) // 
        await writeFile("./render.png", buffer);
    }
}
main();
```
Output:

<img src="assets/images/render.png" width=100>

You can customize the model, camera and lighting options

```ts
import { RenderCrops, RenderTypes, fetchSkinRender } from "starlightskinapi";
import { writeFile } from "node:fs/promises"

async function main(){
    const playerNickname = "RinckoZ_";

    const renderResult = await fetchSkinRender(playerNickname, {
        type: RenderTypes.Default,
        crop: RenderCrops.Full,
        model: {
            capeEnabled: true,
            // ... other model options ...
        },
        camera: {
            cameraPosition: { x: "10", y: "10", z: "-20" },
            cameraWidth: 720,
            cameraHeight: 1080,
            // ... other camera options ...
        },
        lighting: {
            dirLightPos: { x: "-10", y: "10", z: "-10" },
            // ... other lighting options ...
        },
    });

    if (!renderResult.success){
        console.log(renderResult.error)
        return;
    }

    if (renderResult.success){
        const { buffer } = renderResult;
        await writeFile("./customized.png", buffer);
    }
}
main();
```

Output:

<img src="assets/images/customized.png" width=200>


## Full Render Type List

| Render Types | Supported Crops | Preview |
| ------------ | --------------- | ------- |
| Default | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/default/RinckoZ_/full" width=40> |
| Marching | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/marching/RinckoZ_/full" width=40> |
| Walking | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/walking/RinckoZ_/full" width=40> |
| Crouching | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/crouching/RinckoZ_/full" width=40> |
| Crossed | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/crossed/RinckoZ_/full" width=40> |
| CrissCross| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/criss_cross/RinckoZ_/full" width=40> |
| Cheering| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/cheering/RinckoZ_/full" width=40> |
| Relaxing| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/relaxing/RinckoZ_/full" width=40> |
| Trudging | Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/trudging/RinckoZ_/full" width=40> |
| Cowering| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/cowering/RinckoZ_/full" width=40> |
| Pointing| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/pointing/RinckoZ_/full" width=40> |
| Lunging| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/lunging/RinckoZ_/full" width=40> |
| Dungeons| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/dungeons/RinckoZ_/full" width=40> |
| Facepalm| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/facepalm/RinckoZ_/full" width=40> |
| Sleeping| Full, Bust | <img src="https://starlightskins.lunareclipse.studio/render/sleeping/RinckoZ_/full" width=40> |
| Dead| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/dead/RinckoZ_/full" width=40> |
| Archer| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/archer/RinckoZ_/full" width=40> |
| Facepalm| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/kicking/RinckoZ_/full" width=40> |
| Mojavatar| Full, Bust | <img src="https://starlightskins.lunareclipse.studio/render/mojavatar/RinckoZ_/full" width=40> |
| Ultimate| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/ultimate/RinckoZ_/full" width=40> |
| Isometric| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/isometric/RinckoZ_/full" width=40> |
| Head| Full | <img src="https://starlightskins.lunareclipse.studio/render/head/RinckoZ_/full" width=40> |
| Bitzel| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/bitzel/RinckoZ_/full" width=40> |
| Pixel| Full, Bust, Face | <img src="https://starlightskins.lunareclipse.studio/render/pixel/RinckoZ_/full" width=40> |
| Ornament| Full | <img src="https://starlightskins.lunareclipse.studio/render/ornament/RinckoZ_/full" width=40> |
| Skin| Default, Processed | <img src="https://starlightskins.lunareclipse.studio/render/skin/RinckoZ_/default" width=40> |

---
_Source: https://npm.io/package/starlightskinapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
