You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically handle sending additional requests to appear like the official app
Use a storage provider to automatically handle getting/updating cached tokens
Storage providers
Add a storage provider interface implemented by JS library dependents for token management with API client wrappers.
Make a default storage provider that uses a separate directory for each user and use that with the app/cli. (Users can then be removed just by deleting that directory.)
Example
import{addUserAgent,LocalStorageProvider,Storage}from'nxapi';import{CoralUser}from'nxapi/coral';addUserAgent('my-project/1.0.0 (+https://github.com/...)');conststorage=awaitStorage.create(LocalStorageProvider,newURL('../data',import.meta.url));constcoral=awaitCoralUser.create(storage,'naid');// Get friends list// If updated in the last 30s the cached data is returnedconstfriends=awaitcoral.getFriends();
Add complete wrappers for the API clients, similar to the
CoralUser
class used internally:Storage providers
Add a storage provider interface implemented by JS library dependents for token management with API client wrappers.
Make a default storage provider that uses a separate directory for each user and use that with the app/cli. (Users can then be removed just by deleting that directory.)
Example
https://github.com/samuelthomas2774/splatoon3-replay-lookup is using the client added in 788083b. The API will change.
The text was updated successfully, but these errors were encountered: