A simple, fast and functional npm package for HoYoLAB check-ins in your project.
- Supports Honkai: Star Rail, Genshin Impact, Honkai Impact 3rd, Zenless Zone Zero, and Tears of Themis.
- Supports Honkai: Star Rail, Genshin Impact, Honkai Impact 3rd and Tears of Themis (if anyone even plays that...)
- Supports custom user agents, and defaults to a human-browser one if not provided.
- Small, efficient and functional.
Installing is done via NPM.
npm install hoyocheckin
First, get your HoYoLAB cookie:
- Go to HoYoLAB and log in.
- Open DevTools (F12), go to the Application tab (Chrome) or Storage tab (Firefox).
- Under Cookies, find
ltoken_v2andltuid_v2. - Copy the full cookie string in the format:
ltuid_v2=YOUR_LTUID; ltoken_v2=YOUR_LTOKEN;
You can also include other cookie fields like account_mid_v2, account_id_v2, and ltmid_v2 if available.
const { checkIn, HoyoGame } = require('hoyocheckin');
const cookie = 'ltuid_v2=YOUR_LTUID; ltoken_v2=YOUR_LTOKEN;';
const game = HoyoGame.StarRail; // Genshin, HKImpact, Zenless, or TearsOfThemis
const game = HoyoGame.StarRail; // You can replace this with Genshin, HKImpact or TearsOfThemis, for those respective games.
try {
const checkInResult = await checkIn(cookie, game);
console.log('Check-in successful:', checkInResult);
} catch (error) {
console.error('Check-in failed:', error.message);
}If you would like to use a custom User-Agent:
const userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";
const checkInResult = await checkIn(cookie, game, false, userAgent);You can also check if the user has already checked in:
const checkInResult = await checkIn(cookie, game);
if (checkInResult.alreadyCheckedIn) {
console.log(checkInResult.message);
}HoYoLAB returns a custom message if check-in is already done:
- Star Rail:
You've already checked in today, Trailblazer~ - Genshin Impact:
Traveler, you've already checked in today~ - Honkai Impact 3rd:
You have already signed in, Captain~
| Game | Enum |
|---|---|
| Honkai: Star Rail | HoyoGame.StarRail |
| Genshin Impact | HoyoGame.Genshin |
| Honkai Impact 3rd | HoyoGame.HKImpact |
| Zenless Zone Zero | HoyoGame.Zenless |
| Tears of Themis | HoyoGame.TearsOfThemis |
If you have any features or fixes you'd like to contribute, open a PR.