
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
enka-network-api
Advanced tools

A Node.js Enka.Network API wrapper for Genshin Impact.
This is NOT the source code of Enka.Network or its API.
[!TIP] If you need a wrapper for Honkai: Star Rail, you can use starrail.js.
Node.js 16 or newer is required.
Install enka-network-api including genshin cache data.
npm install enka-network-api@latest
npm install enka-network-api@latest --enka-ghproxy=true
If you have already moved the cache to another folder, you can also install without downloading the cache.
npm install enka-network-api@latest --enka-nocache=true
Genshin cache data is from Dimbreath/AnimeGameData (gitlab).
This data contains data of characters, weapons, materials, and more structure information of Genshin Impact.
You can change your cache directory.
const { EnkaClient } = require("enka-network-api");
// Change the directory to store cache data.
// Default directory is node_modules/enka-network-api/cache.
const enka = new EnkaClient();
enka.cachedAssetsManager.cacheDirectoryPath = "./cache";
enka.cachedAssetsManager.cacheDirectorySetup();
// OR
const enka = new EnkaClient({ cacheDirectory: "./cache" });
enka.cachedAssetsManager.cacheDirectorySetup();
You can update your genshin cache data.
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient({ showFetchCacheLog: true }); // showFetchCacheLog is true by default
enka.cachedAssetsManager.fetchAllContents(); // returns promise
Also, you can activate auto cache updater.
When using the auto-cache updater, we recommend moving the cache directory directly under your project folder.
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();
enka.cachedAssetsManager.activateAutoCacheUpdater({
instant: true, // Run the first update check immediately
timeout: 60 * 60 * 1000, // 1 hour interval
onUpdateStart: async () => {
console.log("Updating Genshin Data...");
},
onUpdateEnd: async () => {
enka.cachedAssetsManager.refreshAllData(); // Refresh memory
console.log("Updating Completed!");
}
});
// // deactivate
// enka.cachedAssetsManager.deactivateAutoCacheUpdater();
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();
enka.fetchUser(825436941).then(user => {
console.log(user);
});
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();
const characters = enka.getAllCharacters();
// print character names in language "en"
console.log(characters.map(c => c.name.get("en")));
const { EnkaClient } = require("enka-network-api");
const enka = new EnkaClient();
const weapons = enka.getAllWeapons();
// print weapon names in language "jp"
console.log(weapons.map(w => w.name.get("jp")));
More examples are available in example folder.
For more information, please check Documentation.
You can see the changelog here.
FAQs
Enka-network API wrapper for Genshin Impact.
The npm package enka-network-api receives a total of 172 weekly downloads. As such, enka-network-api popularity was classified as not popular.
We found that enka-network-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.