# @byu-oit-sdk/client-identities

> BYU Identities v2 API

Latest version **0.13.0** (published 2026-04-29) · 0 weekly downloads

## Install

```sh
npm install @byu-oit-sdk/client-identities
pnpm add @byu-oit-sdk/client-identities
yarn add @byu-oit-sdk/client-identities
bun add @byu-oit-sdk/client-identities
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.13.0 |
| Published | 2026-04-29 |
| First published | 2022-11-11 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 5 |
| Unpacked size | 137 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | stuft2, byu-oit-bot |

## Links

- npm: https://www.npmjs.com/package/@byu-oit-sdk/client-identities
- Repository: https://github.com/byu-oit-sdk/javascript
- Homepage: https://github.com/byu-oit-sdk/javascript#readme
- Issues: https://github.com/byu-oit-sdk/javascript/issues
- npm.io page: https://npm.io/package/@byu-oit-sdk/client-identities

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0
- [@byu-oit/logger](https://npm.io/package/@byu-oit/logger.md) ^2.0.0
- [@byu-oit-sdk/client](https://npm.io/package/@byu-oit-sdk/client.md) ^0.13.0
- [@byu-oit-sdk/middleware-stack](https://npm.io/package/@byu-oit-sdk/middleware-stack.md) ^0.9.0
- [@byu-oit-sdk/credential-provider](https://npm.io/package/@byu-oit-sdk/credential-provider.md) ^0.20.0

## Recent versions

- 0.13.0 (latest) — 2026-04-29
- 0.12.0 — 2026-04-06
- 0.11.0 — 2025-07-22
- 0.10.6 — 2025-05-01
- 0.10.5 — 2025-04-01
- 0.10.4 — 2025-03-18
- 0.10.3 — 2025-03-12
- 0.10.2 — 2025-02-20
- 0.10.1 — 2025-02-19
- 0.10.0 — 2025-01-23
- 0.9.20 — 2025-01-22
- 0.9.19 — 2025-01-21
- 0.9.18 — 2025-01-21
- 0.9.17 — 2024-11-14
- 0.9.16 — 2024-10-29
- … 57 more at https://npm.io/package/@byu-oit-sdk/client-identities/versions

## README

# @byu-oit-sdk/client-identities

**Requirements**:

- Node.js 18+
    - or Node.js 10+ with fetch and crypto polyfills
- npm v9+

Review the [Client](https://byu-oit-sdk.github.io/javascript/modules/Client.html) documentation for details on
what Clients and Commands are.

The Identities Client is an extension of the default client that is specifically designed for making
[Persons](https://api.byu.edu/byuapi/persons) API calls.

## Usage

Initializing the client is simple. The Identities Client can be configured with some options to override the default behavior if desired.

```typescript
const client = new IdentitiesClient()
// or
const client = new IdentitiesClient({ /* options here */ })
```
Here are a list of supported options:

| Option      | Type                                                                                                                   | Default Value                                                                                                                             | Purpose                                                                                                                                           |
|-------------|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| logger      | `Logger`, from pino                                                                                                    | `Pino()`                                                                                                                                  | *(Optional)* Logging information from client functionality                                                                                        |
| credentials | [`CredentialProvider`](https://byu-oit-sdk.github.io/javascript/modules/Credential_Provider.html)                      | [`ChainedCredentialProvider()`](https://byu-oit-sdk.github.io/javascript/modules/Credential_Provider.html#md:chained-credential-provider) | *(Optional)* The credential provider used resolving access tokens                                                                                 | 
| retry       | [`{ strategy: RetryMiddlewareConfiguration }`](https://byu-oit-sdk.github.io/javascript/modules/Middleware_Retry.html) | `{ strategy: new RetryStrategy() }`                                                                                                       | *(Optional)* Configures the retry middleware. The default configuration will attempt one retry when the response contains a 401 HTTP status code. |

The default credential provider is
the [Client Credentials provider](https://byu-oit-sdk.github.io/javascript/modules/Credential_Provider.html). Any of the parameters that it
accepts may be supplied via environment variables with the prefix `BYU_OIT_`. If a different credential provider is
needed, such as the [Authorization Code provider](https://byu-oit-sdk.github.io/javascript/modules/Credential_Provider.html), it should be
configured and passed into the BYU Client constructor.

The default retry strategy retries once on 401 HTTP response codes after a 100-millisecond delay. The token middleware
will try to get a new token before the request is sent. Any middleware added after the retry middleware will also be
invoked prior to each request retry.

## Commands

All commands are available as methods on the class for convenience. For example:

```js
const data = await client.getIdentity({ byuId: '123456789' })
```

Currently only two commands are supported: `GetIdentityCommand` and `GetGroupMembershipsCommand`. PRs welcome!

### GetIdentityCommand

Use this command to get information about a persons identity(ies)
(under the hood, the `/{byu_id}` identities endpoint is called).
There is only one parameter: an object that contains a `byuId` (string) and (optionally) a `fieldSets` (string array).
```ts
const command = new GetIdentityCommand({
  byuId: '903093516',
  fieldSets: ['basic', 'group_memberships']
})
const data = await client.send(command)
```

See [GetIdentityInput](https://byu-oit-sdk.github.io/javascript/docs/classes/Client_Identities.GetIdentityInput.html#constructor) for a list of supported field sets.

See [GetIdentityBasicOutput](https://byu-oit-sdk.github.io/javascript/classes/Client_Identities.GetIdentityBasicOutput.html) for information about the data that is returned.

### GetGroupMembershipsCommand
Use this command to get information about a persons group memberships
(under the hood, the `/{byu_id}/group_memberships` identities endpoint is called).
There is only one parameter: an object that contains a `byuId` (string) and (optionally) a `groupIds` (string array).

```ts
const command = new GetGroupMembershipsCommand({
  byuId: '903093516',
  groupIds: ['OIT-ALL']
})
const data = await client.send(command)
```

See [GetGroupMembershipsOutput](https://byu-oit-sdk.github.io/javascript/classes/Client_Identities.GetGroupMembershipsOutput.html) for information about the data that is returned.

---
_Source: https://npm.io/package/@byu-oit-sdk/client-identities · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
