TypeScript SDK: Passport

The methods of the TypeScript client under Passport. The outside services an inbox's address is signed up for, the verification codes and sign-in links they send, and how the address signs in to the ones that accept Sign in with Doorman.

client.inboxes.services.create

TypeScript

client.inboxes.services.create(inboxId: string, body: CreateService): Promise<Service>

Sends inboxes.services.create: POST /v1/inboxes/{inboxId}/services

Call it before signing up, so the service is recorded as pending and attributed to the caller, and the codes and links its domain sends are tied to it. A domain the inbox already has answers with that service.

Access any: any API key, or a console session. An app token needs mail:write and mail:read.

client.inboxes.verifications.list

TypeScript

client.inboxes.verifications.list(inboxId: string, params: ListVerificationsParams = {}): Promise<VerificationList>

Sends inboxes.verifications.list: GET /v1/inboxes/{inboxId}/verifications

Newest first. With domain and waitSeconds, the call waits for the code the service is about to send. Use one only when verified is true, and open a link only when its matchesSender is true.

Access any: any API key, or a console session. An app token needs mail:read.

client.inboxes.signIns.create

TypeScript

client.inboxes.signIns.create(inboxId: string, body: StartSignIn): Promise<SignInStart>

Sends inboxes.signIns.create: POST /v1/inboxes/{inboxId}/sign-ins

Signs the inbox's address in to a service that accepts Sign in with Doorman, named by its domain or by the relying party's clientId. Call it only when your user asked for that service. The answer's status says what comes next. ready carries url, a single-use link: open it at once in the browser that should hold the session, and never store it or show it to anyone. approval_required carries approvalUrl, where the owner allows the service before you call again. blocked means the owner stopped it: do not sign in there another way. unsupported means the service takes its own form and the verification codes.

Access any: any API key, or a console session. An app token needs mail:write and mail:read. Part of Sign in with Doorman, which a deployment switches on: where it is off, the call answers 404 not_found.

client.passport.get

TypeScript

client.passport.get(): Promise<PassportSettings>

Sends passport.get: GET /v1/passport

Owner alert emails, with the owner address and whether email sending is available; and whether agents may sign in to services the owner has not allowed yet (agentSignIn) and tell them who owns the agent (shareOwner), with whether the deployment has sign-in switched on.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.passport.update

TypeScript

client.passport.update(body: UpdatePassportSettings): Promise<PassportSettings>

Sends passport.update: PATCH /v1/passport

Change any of alertEmails, agentSignIn and shareOwner; the ones left out stay as they are. Switching alert emails off, and switching either of the other two on, needs a console session unless allowed.

Access account: an account-scoped key or a console session; an inbox-scoped key gets 403 forbidden. App tokens are refused.

client.services.list

TypeScript

client.services.list(params: ListServicesParams = {}): Promise<ServicePage>

Sends services.list: GET /v1/services

Newest activity first. Archived services are left out unless status asks for them.

Access any: any API key, or a console session. An app token needs mail:read.

client.services.iterate

TypeScript

client.services.iterate(params: ListServicesParams = {}): AsyncGenerator<Service, void, undefined>

Every service of the passport, page by page.

client.services.get

TypeScript

client.services.get(serviceId: string): Promise<ServiceDetail>

Sends services.get: GET /v1/services/{serviceId}

One service with the messages that tied it to the address, never their text.

Access any: any API key, or a console session. App tokens are refused.

client.services.update

TypeScript

client.services.update(serviceId: string, body: UpdateService): Promise<Service>

Sends services.update: PATCH /v1/services/{serviceId}

Rename it, change its status, replace its note or plan, or decide about one of its sign-ins (signIn). Omitted fields are preserved. Stopping a sign-in is open to any key that reaches the service; allowing one needs a console session unless allowed.

Access any: any API key, or a console session. App tokens are refused.

client.services.delete

TypeScript

client.services.delete(serviceId: string): Promise<void>

Sends services.delete: DELETE /v1/services/{serviceId}

Removes it from the passport; its messages stay. Archive it instead to keep it set aside.

Access any: any API key, or a console session. App tokens are refused.

Up Down to move, Enter to open, Esc to close