๐Ÿ“EnkaNetwork

EnkaNetwork - the class in which all interaction with enka.network takes place

const enka = new EnkaNetwork();

In the example on the last page, we used this class without parameters. Let's figure out what parameters it takes

language

The language to be used in the localization of names (characters, artifacts, etc.). Default is ยซENยป

Full list of supported languages - EN, RU, CHS, CHT, DE, ES, FR, ID, JP, KR, PT, TH, VI

const enka = new EnkaNetwork({ language: "EN" });

caching

The value of this parameter is to enable caching of responses. The default value is ยซtrueยป

false - to disable caching

const enka = new EnkaNetwork({ caching: false });

userAgent

In paragraph 3, the enka.network API documentation states that using custom userAgent is a good practice. Default is ยซenkanetwork@versionยป

false - to disable userAgent in requests

const enka = new EnkaNetwork({ userAgent: false });

string - to set a custom UserAgent in requests

const enka = new EnkaNetwork({ userAgent: "myProjectName" });

uiAssetsPath

The path to which the {icon}.png string will be added. Default is ยซhttps://enka.network/ui/ยป

You can also use another resource

const enka = new EnkaNetwork({
    uiAssetsPath: "https://api.ambr.top/assets/UI/",
});

And now we get links to UI assets from this resource

or you can specify the path to your local folder with ui assets

const enka = new EnkaNetwork({
    uiAssetsPath: "/root/enka/assets/",
});

assets

Params for AssetsUpdater

๐Ÿ’พpageAssetsUpdater

Last updated