@masks/client
The BFF and browser-PKCE halves of @masks/client, generated from its TypeScript by
./dev reference. CI fails when this page and the source disagree.
Classes
Section titled “Classes”MasksError
Section titled “MasksError”Defined in: types.ts:82
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MasksError( code, description?, status?): MasksError;Defined in: types.ts:87
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code |
string |
description? |
string |
status? |
number |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”| Property | Modifier | Type | Defined in |
|---|---|---|---|
code |
readonly |
string |
types.ts:83 |
description? |
readonly |
string |
types.ts:84 |
status? |
readonly |
number |
types.ts:85 |
Interfaces
Section titled “Interfaces”Account
Section titled “Account”Defined in: types.ts:22
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
account_url? |
string |
types.ts:36 |
avatars? |
Avatars |
types.ts:30 |
email? |
string |
types.ts:27 |
email_verified? |
boolean |
types.ts:28 |
expires_at? |
number |
types.ts:35 |
name? |
string |
types.ts:25 |
nickname? |
string |
types.ts:26 |
organization? |
Organization |
types.ts:32 |
organizations? |
Organization[] |
types.ts:33 |
picture? |
string |
types.ts:29 |
scopes |
string[] |
types.ts:34 |
signed_in |
boolean |
types.ts:23 |
subject? |
string |
types.ts:24 |
tenant? |
Tenant |
types.ts:31 |
AuthorizeOptions
Section titled “AuthorizeOptions”Defined in: browser.ts:34
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
organization? |
string |
browser.ts:37 |
prompt? |
string |
browser.ts:36 |
returnTo? |
string |
browser.ts:35 |
Avatars
Section titled “Avatars”Defined in: types.ts:9
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
identicon |
string |
types.ts:11 |
initials |
string |
types.ts:12 |
photo |
string | null |
types.ts:10 |
BrowserClient
Section titled “BrowserClient”Defined in: browser.ts:40
Methods
Section titled “Methods”accessToken()
Section titled “accessToken()”accessToken(): string | null;Defined in: browser.ts:62
Returns
Section titled “Returns”string | null
authorization()
Section titled “authorization()”authorization(): string | null;Defined in: browser.ts:64
Returns
Section titled “Returns”string | null
authorize()
Section titled “authorize()”authorize(options?): Promise<void>;Defined in: browser.ts:42
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
AuthorizeOptions |
Returns
Section titled “Returns”Promise<void>
authorizeUrl()
Section titled “authorizeUrl()”authorizeUrl(options?): Promise<string>;Defined in: browser.ts:43
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
AuthorizeOptions |
Returns
Section titled “Returns”Promise<string>
avatars()
Section titled “avatars()”avatars(): Avatars | null;Defined in: browser.ts:55
Returns
Section titled “Returns”Avatars | null
avatarUrl()
Section titled “avatarUrl()”avatarUrl(subject, options?): Promise<string>;Defined in: browser.ts:56
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
subject |
string |
options? |
{ size?: number; style?: AvatarStyle; } |
options.size? |
number |
options.style? |
AvatarStyle |
Returns
Section titled “Returns”Promise<string>
callback()
Section titled “callback()”callback(url?): Promise<{ identity: Claims | null; returnTo: string; tokens: Tokens;}>;Defined in: browser.ts:45
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
url? |
string |
Returns
Section titled “Returns”Promise<{
identity: Claims | null;
returnTo: string;
tokens: Tokens;
}>
discover()
Section titled “discover()”discover(): Promise<Discovery>;Defined in: browser.ts:41
Returns
Section titled “Returns”Promise<Discovery>
expired()
Section titled “expired()”expired(leeway?): boolean;Defined in: browser.ts:65
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
leeway? |
number |
Returns
Section titled “Returns”boolean
identity()
Section titled “identity()”identity(): Claims | null;Defined in: browser.ts:48
Returns
Section titled “Returns”Claims | null
logout()
Section titled “logout()”logout(): void;Defined in: browser.ts:66
Returns
Section titled “Returns”void
organization()
Section titled “organization()”organization(): Organization | null;Defined in: browser.ts:49
Returns
Section titled “Returns”Organization | null
organizations()
Section titled “organizations()”organizations(): Organization[];Defined in: browser.ts:50
Returns
Section titled “Returns”pending()
Section titled “pending()”pending(): boolean;Defined in: browser.ts:44
Returns
Section titled “Returns”boolean
photo()
Section titled “photo()”photo(subject?): Promise<Blob | null>;Defined in: browser.ts:60
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
subject? |
string |
Returns
Section titled “Returns”Promise<Blob | null>
refresh()
Section titled “refresh()”refresh(): Promise<Tokens>;Defined in: browser.ts:61
Returns
Section titled “Returns”Promise<Tokens>
switchOrganization()
Section titled “switchOrganization()”switchOrganization(key, options?): Promise<void>;Defined in: browser.ts:51
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
options? |
Omit<AuthorizeOptions, "organization"> |
Returns
Section titled “Returns”Promise<void>
tokens()
Section titled “tokens()”tokens(): Tokens | null;Defined in: browser.ts:63
Returns
Section titled “Returns”Tokens | null
BrowserOptions
Section titled “BrowserOptions”Defined in: browser.ts:15
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
clientId |
string |
browser.ts:17 |
fetch? |
(input, init?) => Promise<Response> |
browser.ts:22 |
issuer |
string |
browser.ts:16 |
organization? |
string |
browser.ts:21 |
redirectUri |
string |
browser.ts:18 |
resource? |
string | string[] |
browser.ts:20 |
scope? |
string | string[] |
browser.ts:19 |
storage? |
Storage |
browser.ts:23 |
Claims
Section titled “Claims”Defined in: types.ts:51
Indexable
Section titled “Indexable”[claim: string]: unknownProperties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
org? |
Organization |
types.ts:52 |
orgs? |
Organization[] |
types.ts:53 |
Discovery
Section titled “Discovery”Defined in: types.ts:67
Indexable
Section titled “Indexable”[claim: string]: unknownProperties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
authorization_endpoint |
string |
types.ts:69 |
avatar_endpoint? |
string |
types.ts:72 |
avatar_sizes_supported? |
number[] |
types.ts:74 |
avatar_styles_supported? |
AvatarStyle[] |
types.ts:73 |
end_session_endpoint? |
string |
types.ts:77 |
issuer |
string |
types.ts:68 |
jwks_uri? |
string |
types.ts:75 |
revocation_endpoint? |
string |
types.ts:76 |
tenant? |
Tenant |
types.ts:78 |
token_endpoint |
string |
types.ts:70 |
userinfo_endpoint? |
string |
types.ts:71 |
Defined in: jwt.ts:11
Extends
Section titled “Extends”JsonWebKey
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
kid? |
string |
jwt.ts:12 |
LoginOptions
Section titled “LoginOptions”Defined in: session.ts:16
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
organization? |
string |
session.ts:18 |
returnTo? |
string |
session.ts:17 |
Organization
Section titled “Organization”Defined in: types.ts:15
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
id |
string |
types.ts:16 |
key |
string |
types.ts:17 |
name |
string |
types.ts:18 |
role |
string |
types.ts:19 |
PersonInfo
Section titled “PersonInfo”Defined in: person.ts:3
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
details |
string[] |
person.ts:5 |
manager |
boolean |
person.ts:7 |
name |
string |
person.ts:4 |
organization |
Organization | null |
person.ts:8 |
organizations |
Organization[] |
person.ts:9 |
others |
Organization[] |
person.ts:10 |
owner |
boolean |
person.ts:12 |
role |
string | null |
person.ts:11 |
unconfirmed |
boolean |
person.ts:6 |
Refusal
Section titled “Refusal”Defined in: types.ts:39
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
error |
string |
types.ts:41 |
handshake_url? |
string |
types.ts:43 |
login_url? |
string |
types.ts:42 |
signed_in |
false |
types.ts:40 |
SessionClient
Section titled “SessionClient”Defined in: session.ts:21
Methods
Section titled “Methods”avatarUrl()
Section titled “avatarUrl()”avatarUrl(account, options?): string | null;Defined in: session.ts:33
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
account |
Account | null |
options? |
{ size?: number; style?: AvatarStyle; } |
options.size? |
number |
options.style? |
AvatarStyle |
Returns
Section titled “Returns”string | null
handshake()
Section titled “handshake()”handshake(): void;Defined in: session.ts:31
Returns
Section titled “Returns”void
handshakeUrl()
Section titled “handshakeUrl()”handshakeUrl(): string;Defined in: session.ts:32
Returns
Section titled “Returns”string
login()
Section titled “login()”login(options?): void;Defined in: session.ts:25
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
LoginOptions |
Returns
Section titled “Returns”void
loginUrl()
Section titled “loginUrl()”loginUrl(options?): string;Defined in: session.ts:30
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
LoginOptions |
Returns
Section titled “Returns”string
logout()
Section titled “logout()”logout(options?): Promise<void>;Defined in: session.ts:37
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
{ everywhere?: boolean; } |
options.everywhere? |
boolean |
Returns
Section titled “Returns”Promise<void>
require()
Section titled “require()”require(options?): Promise<Account>;Defined in: session.ts:24
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
LoginOptions |
Returns
Section titled “Returns”Promise<Account>
session()
Section titled “session()”session(): Promise<Account | null>;Defined in: session.ts:22
Returns
Section titled “Returns”Promise<Account | null>
status()
Section titled “status()”status(): Promise<Status>;Defined in: session.ts:23
Returns
Section titled “Returns”Promise<Status>
switchOrganization()
Section titled “switchOrganization()”switchOrganization(key, options?): void;Defined in: session.ts:26
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key |
string |
options? |
Omit<LoginOptions, "organization"> |
Returns
Section titled “Returns”void
SessionOptions
Section titled “SessionOptions”Defined in: session.ts:10
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
basePath? |
string |
session.ts:11 |
csrfToken? |
() => string | null |
session.ts:13 |
fetch? |
(input, init?) => Promise<Response> |
session.ts:12 |
Tenant
Section titled “Tenant”Defined in: types.ts:1
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
name? |
string |
types.ts:4 |
subdomain? |
string |
types.ts:3 |
uuid? |
string |
types.ts:2 |
Tokens
Section titled “Tokens”Defined in: types.ts:57
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
access_token |
string |
types.ts:58 |
expires_in |
number |
types.ts:63 |
id_token? |
string |
types.ts:59 |
obtained_at |
number |
types.ts:64 |
refresh_token? |
string |
types.ts:60 |
scope |
string |
types.ts:62 |
token_type |
string |
types.ts:61 |
VerifyOptions
Section titled “VerifyOptions”Defined in: jwt.ts:15
Properties
Section titled “Properties”| Property | Type | Defined in |
|---|---|---|
audience |
string |
jwt.ts:17 |
issuer |
string |
jwt.ts:16 |
keyFor |
(kid) => Promise<Jwk> |
jwt.ts:20 |
leeway? |
number |
jwt.ts:19 |
nonce |
string |
jwt.ts:18 |
Type Aliases
Section titled “Type Aliases”AvatarStyle
Section titled “AvatarStyle”type AvatarStyle = "photo" | "identicon" | "initials";Defined in: types.ts:7
Status
Section titled “Status”type Status = | { account: Account; state: "signed_in";} | { loginUrl: string; state: "signed_out";} | { handshakeUrl: string; state: "handshake_required";};Defined in: types.ts:46
Functions
Section titled “Functions”createBrowserClient()
Section titled “createBrowserClient()”function createBrowserClient(options): BrowserClient;Defined in: browser.ts:75
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
BrowserOptions |
Returns
Section titled “Returns”createSession()
Section titled “createSession()”function createSession(options?): SessionClient;Defined in: session.ts:60
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
SessionOptions |
Returns
Section titled “Returns”holdsRole()
Section titled “holdsRole()”function holdsRole(account, ...roles): boolean;Defined in: person.ts:42
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
account |
Account |
…roles |
string[] |
Returns
Section titled “Returns”boolean
initials()
Section titled “initials()”function initials(name): string;Defined in: person.ts:48
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”string
personFrom()
Section titled “personFrom()”function personFrom(account): PersonInfo;Defined in: person.ts:15
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
account |
Account |
Returns
Section titled “Returns”verifyIdToken()
Section titled “verifyIdToken()”function verifyIdToken(token, __namedParameters): Promise<Claims>;Defined in: jwt.ts:51
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
token |
string |
__namedParameters |
VerifyOptions |
Returns
Section titled “Returns”Promise<Claims>