Skip to main content
The official SDK wraps both flows, manages tokens, and exposes the REST API as typed resources.

Install

Two clients

Nemu

The client credentials client. It fetches and caches a token from your client_id and client_secret. It acts as your own account.

NemuOAuth

The authorization code client. It builds the authorize URL, exchanges the code, and refreshes tokens. It acts as the user who approved access.

Client credentials

Authorization code

Restore a session later with from_tokens, and persist rotated tokens with on_refresh.

Options

Both clients accept the same options.
string
required
Your application client_id.
string
required
Your application client_secret.
string
Required for NemuOAuth. Must match a registered redirect URI.
string
The dated API version to pin. Defaults to the latest version the SDK knows about.
string
default:"https://platform.nemu.cc/api/v1"
The versioned REST base.
number
default:"30000"
Request timeout in milliseconds.

The user resource

get and me both return the user described in Get the current user.

Version helpers

Working with resources

Resources return live entities you can act on directly.

Errors

The SDK throws typed errors so you can branch on the failure.