diff --git a/README.md b/README.md index b2ab1b3..1790c94 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ JavaScript library and command line and Electron app for accessing the Nintendo - Command line and Electron app interfaces - Interactive Nintendo Account login for the Nintendo Switch Online and Nintendo Switch Parental Controls apps - Automated login to the Nintendo Switch Online app API - - This uses splatnet2statink and flapg APIs by default. - - Alternatively the imink API or a custom server can be used. + - This uses the imink API by default. + - Alternatively a custom server can be used. - A custom server using a rooted Android device/emulator is included. - Get Nintendo Switch account information, friends list and game-specific services - Show Discord Rich Presence using your own or a friend's Nintendo Switch presence @@ -327,13 +327,13 @@ const records = await splatnet2.getRecords(); ### Coral client authentication -The splatnet2statink and flapg APIs are used by default to automate authenticating to the Nintendo Switch Online app's API and authenticating to web services. An access token (`id_token`) created by Nintendo must be sent to these APIs to generate some data that is required to authenticate the app. These APIs run the Nintendo Switch Online app in an Android emulator to generate this data. The access token sent includes some information about the authenticated Nintendo Account and can be used to authenticate to the Nintendo Switch Online app and web services. +The [imink API](https://github.com/JoneWang/imink/wiki/imink-API-Documentation) is used by default to automate authenticating to the Nintendo Switch Online app's API and authenticating to web services. An access token (`id_token`) created by Nintendo must be sent to this API to generate some data that is required to authenticate the app. This API runs the Nintendo Switch Online app on an Android device to generate this data. The access token sent includes some information about the authenticated Nintendo Account and can be used to authenticate to the Nintendo Switch Online app and web services. Specifically, the tokens sent are JSON Web Tokens. The token sent to login to the app includes [this information and is valid for 15 minutes](https://gitlab.fancy.org.uk/samuel/nxapi/-/wikis/Nintendo-tokens#nintendo-account-id_token), and the token sent to login to web services includes [this information and is valid for two hours](https://gitlab.fancy.org.uk/samuel/nxapi/-/wikis/Nintendo-tokens#nintendo-switch-online-app-token). -Alternatively the [imink API](https://github.com/JoneWang/imink/wiki/imink-API-Documentation) can be used by setting the `NXAPI_ZNCA_API` environment variable to `imink`. (`NXAPI_ZNCA_API=imink nxapi nso ...`) +Alternatively the [splatnet2statink and flapg APIs](https://github.com/frozenpandaman/splatnet2statink/wiki/api-docs) can be used by setting the `NXAPI_ZNCA_API` environment variable to `flapg`. Note that the splatnet2statink API, which is required to use the flapg API, is deprecated in favour of using only the imink API and scheduled to be shut down by the end of 2022. (`NXAPI_ZNCA_API=flapg nxapi nso ...`) -> Since v1.3.0 the default API to use will be fetched from my server and can be changed without an update to nxapi. To force the use of the splatnet2statink and flapg APIs, set the `NXAPI_ZNCA_API` environment variable to `flapg`. +> Since v1.3.0 the default API to use will be fetched from my server and can be changed without an update to nxapi. To force the use of the imink API, set the `NXAPI_ZNCA_API` environment variable to `imink`. nxapi also includes a custom server using Frida on an Android device/emulator that can be used instead of these. @@ -353,7 +353,7 @@ The reason Nintendo added this is probably to try and stop people automating acc - nxapi includes TypeScript definitions of all API resources and JSON Web Token payloads at [src/api](src/api) - Coral client authentication (`f` parameter) - https://github.com/samuelthomas2774/nxapi/discussions/10 - - https://github.com/frozenpandaman/splatnet2statink/wiki/api-docs - splatnet2statink and flapg API docs + - ~~https://github.com/frozenpandaman/splatnet2statink/wiki/api-docs - splatnet2statink and flapg API docs~~ - https://github.com/JoneWang/imink/wiki/imink-API-Documentation - imink API docs - HTTP debugging proxies - Proxyman - https://proxyman.io diff --git a/docs/lib/index.md b/docs/lib/index.md index 1956cc7..30b5d91 100644 --- a/docs/lib/index.md +++ b/docs/lib/index.md @@ -15,7 +15,7 @@ nxapi exports it's API library and types. nxapi is split into several modules th ### Install -nxapi should be installed as a project dependency rather than a globally installed package. TypeScript definitions are included as do not need to be installed separately. +nxapi should be installed as a project dependency rather than a globally installed package. TypeScript definitions are included and do not need to be installed separately. ```sh # From registry.npmjs.com diff --git a/docs/lib/splatnet2.md b/docs/lib/splatnet2.md index bb157b8..b194554 100644 --- a/docs/lib/splatnet2.md +++ b/docs/lib/splatnet2.md @@ -91,11 +91,11 @@ const league_id = toLeagueId(new Date(Date.UTC(2022, 0, 1, 0)), LeagueType.TEAM) ### `toXRankSeasonId` -Converts a year and month to a string used in X Rank leaderboard requests (`/league_match_ranking/{id}/{region}` or `SplatNet2Api.getLeagueMatchRanking`). +Converts a year and month to a string used in X Rank leaderboard requests (`/x_power_ranking/{season}/{summary/rule}?page={page}` or `SplatNet2Api.getXPowerRankingSummary`/`SplatNet2Api.getXPowerRankingLeaderboard`). Months in this function start from 1, instead of 0 like `Date`s. -This function does not usually need to be used with `SplatNet2Api.getLeagueMatchRanking`, as a `Date` and `LeagueType` can be passed directly to it. +This function does not usually need to be used with `SplatNet2Api.getXPowerRankingSummary` or `SplatNet2Api.getXPowerRankingLeaderboard`, as an `XRankSeason`/`Date` and `XPowerRankingRule` can be passed directly to it. ```ts import { toXRankSeasonId } from 'nxapi/splatnet2'; diff --git a/src/app/main/na-auth.ts b/src/app/main/na-auth.ts index c12e784..dfb8960 100644 --- a/src/app/main/na-auth.ts +++ b/src/app/main/na-auth.ts @@ -299,7 +299,7 @@ async function checkZncaApiUseAllowed(storage: persist.LocalStorage, window?: Br const ZNCA_API_USE_TEXT = `To access the Nintendo Switch Online app API, nxapi must send some data to third-party APIs. This is required to generate some data to make Nintendo think you\'re using the real Nintendo Switch Online app. -By default, this uses the splatnet2statink and flapg APIs, but another service can be used by setting an environment variable. +By default, this uses the imink API, but another service can be used by setting an environment variable. The default API may change without notice if you do not force use of a specific service. The data sent includes: - A random UUID and the current timestamp