Skip to content

RefreshRequestResult — @gj-kit/expo-auth

A public type from @gj-kit/expo-auth. The signature below is taken directly from the 0.1.1 release declaration.

import { RefreshRequestResult } from '@gj-kit/expo-auth';
/**
* The host calls its own HTTP stack against its refresh endpoint and translates the response
* into this three-way classification (design §3.3):
*
* - `'rotated'`: the server issued a new token pair. `tokens` is required — omitting it is a
* compile error (§4.1-②).
* - `'invalid'`: a definitive rejection (401/403 — token revoked or expired). The session ended.
* - `'transient'`: the server could not decide (network error, 5xx, CORS, timeout). The tokens
* may still be valid.
*
* ⚠ If the callback throws, the core treats it as `{ status: 'transient', cause: <thrown value> }`:
* a classifier bug must not fail toward signing the user out (fail-safe in the H1 direction),
* and the thrown value is preserved as `cause` so it is never silently swallowed — it flows to
* the caller's return value and to `onScheduledOutcome`, letting host telemetry distinguish a
* classifier bug from network flapping (§3.4). `cause` is a structured field; the library never
* stringifies it, so this does not conflict with §4.2.
*/
type RefreshRequestResult = {
readonly status: 'rotated';
readonly tokens: TokenPair;
/** Access-token lifetime in seconds, as stated by the server. When present it takes priority over JWT `exp` decoding (§3.6). */
readonly accessTtlSeconds?: number | undefined;
} | {
readonly status: 'invalid';
} | {
readonly status: 'transient';
};

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/expo-auth
  • Version: 0.1.1
  • Public entry: .
  • Source: GitHub