A comprehensive Node.js library for accessing Genshin Impact game data through Enka.Network API and official data sources. Build powerful applications with complete character showcases, weapon stats, artifacts, materials, and real-time player data.
Note: This is a third-party library and not affiliated with Enka.Network or miHoYo.
npm install genshin-manager
EN
, RU
, VI
, TH
, PT
, KR
, JP
, ID
, FR
, ES
, DE
, CHT
, CHS
const { Client } = require('genshin-manager')
// Initialize the client
const client = new Client()
await client.deploy()
console.log('Genshin Manager is ready!')
const { Client, EnkaManager } = require('genshin-manager')
const client = new Client()
await client.deploy()
const enkaManager = new EnkaManager()
const playerData = await enkaManager.fetchAll(800802278) // Replace with valid UID
console.log(`Player: ${playerData.playerDetail.nickname}`)
console.log(`Level: ${playerData.playerDetail.level}`)
console.log(`Characters: ${playerData.characterDetails.length}`)
const { Client, CharacterInfo } = require('genshin-manager')
const client = new Client({ defaultLanguage: 'EN' })
await client.deploy()
// Get character by ID
const ayaka = new CharacterInfo(10000002) // Kamisato Ayaka
console.log(ayaka.name) // "Kamisato Ayaka"
console.log(ayaka.element) // "Cryo"
console.log(ayaka.rarity) // 5
// Search by name
const zhongliIds = CharacterInfo.getCharacterIdByName("Zhongli")
const zhongli = new CharacterInfo(zhongliIds[0])
const { Client, Weapon } = require('genshin-manager')
const client = new Client({ defaultLanguage: 'EN' })
await client.deploy()
// Create weapon instance
const weapon = new Weapon(13501, 90, true, 5) // Staff of Homa, Level 90, Ascended, R5
console.log(weapon.name) // "Staff of Homa"
console.log(weapon.stats) // Array of weapon stats
console.log(weapon.skillName) // "Reckless Cinnabar"
const { Client, CharacterInfo } = require('genshin-manager')
const client = new Client({
defaultLanguage: 'EN',
downloadLanguages: ['EN', 'JP', 'KR']
})
await client.deploy()
const hutao = new CharacterInfo(10000046)
console.log(hutao.name) // "Hu Tao"
// Switch language dynamically
await client.changeLanguage('JP')
console.log(hutao.name) // "胡桃"
const { Client } = require('genshin-manager')
const client = new Client({
assetCacheFolderPath: './my-cache',
autoFetchLatestAssetsByCron: '0 2 * * 1', // Update every Monday at 2 AM
autoCacheImage: true,
showFetchCacheLog: true
})
await client.deploy()
const { Client, ClientEvents, EnkaManagerEvents } = require('genshin-manager')
const client = new Client()
// Listen for cache updates
client.on(ClientEvents.BEGIN_UPDATE_CACHE, (version) => {
console.log(`Updating cache for game version: ${version}`)
})
client.on(ClientEvents.END_UPDATE_CACHE, (version) => {
console.log(`Cache updated successfully for version: ${version}`)
})
await client.deploy()
Game data is sourced from Dimbreath/AnimeGameData and includes:
const { Client } = require('genshin-manager')
const client = new Client({
// Auto-update every Wednesday at midnight (default)
autoFetchLatestAssetsByCron: '0 0 0 * * 3',
// Auto-fix corrupted files
autoFixTextMap: true,
autoFixExcelBin: true,
// Cache images and audio
autoCacheImage: true,
autoCacheAudio: true
})
await client.deploy()
const { Client } = require('genshin-manager')
const client = new Client({ showFetchCacheLog: true })
await client.deploy() // This will update the cache if new data is available
const { Client, NoticeManager, NoticeManagerEvents } = require('genshin-manager')
const client = new Client()
await client.deploy()
const noticeManager = new NoticeManager('en', 300000) // English, update every 5 minutes
// Listen for new notices
noticeManager.on(NoticeManagerEvents.ADD_NOTICE, (notice) => {
console.log(`New notice: ${notice.title}`)
})
await noticeManager.update()
// Access notices
noticeManager.notices.forEach((notice) => {
console.log(`${notice.title} - ${notice.eventDuration}`)
})
Check out the examples directory for:
The library includes comprehensive handbooks for each supported language:
Class | Description |
---|---|
Client |
Main entry point for the library |
EnkaManager |
Handles Enka.Network API interactions |
NoticeManager |
Manages game announcements |
CharacterInfo |
Character data and information |
Weapon |
Weapon stats and properties |
Artifact |
Artifact data and set bonuses |
Material |
Game materials and items |
Monster |
Enemy data and stats |
This project is licensed under the MIT License.
Contributions are welcome! Please read the contributing guidelines and submit pull requests to help improve the library.
View the release history and changelog for detailed information about updates and new features.