---
title: "TypeScript SDK: Passport"
description: "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."
url: https://doorman.fyi/docs/sdk/reference/passport
markdown: https://doorman.fyi/docs/sdk/reference/passport.md
area: "SDKs and tools"
section: "TypeScript SDK"
---

# 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.

Source: https://doorman.fyi/docs/sdk/reference/passport

## client.inboxes.services.create

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

Operation [`inboxes.services.create`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.inboxes.verifications.list(inboxId: string, params: ListVerificationsParams = {}): Promise<VerificationList>
```

Operation [`inboxes.verifications.list`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.inboxes.signIns.create(inboxId: string, body: StartSignIn): Promise<SignInStart>
```

Operation [`inboxes.signIns.create`](https://doorman.fyi/docs/reference/passport.md#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](https://doorman.fyi/docs/passport.md#sign-in), which a deployment switches on: where it is off, the call answers `404 not_found`.

## client.passport.get

TypeScript:
```ts
client.passport.get(): Promise<PassportSettings>
```

Operation [`passport.get`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.passport.update(body: UpdatePassportSettings): Promise<PassportSettings>
```

Operation [`passport.update`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.services.list(params: ListServicesParams = {}): Promise<ServicePage>
```

Operation [`services.list`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.services.iterate(params: ListServicesParams = {}): AsyncGenerator<Service, void, undefined>
```

Every service of the passport, page by page.

## client.services.get

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

Operation [`services.get`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.services.update(serviceId: string, body: UpdateService): Promise<Service>
```

Operation [`services.update`](https://doorman.fyi/docs/reference/passport.md#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:
```ts
client.services.delete(serviceId: string): Promise<void>
```

Operation [`services.delete`](https://doorman.fyi/docs/reference/passport.md#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.
