# @atproto/identifier

> Validation logic for AT identifiers - DIDs & Handles

Latest version **0.2.1** (published 2023-09-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @atproto/identifier
pnpm add @atproto/identifier
yarn add @atproto/identifier
bun add @atproto/identifier
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2023-09-15 |
| First published | 2023-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 43.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9733 |
| Maintainers | estrattonbailey, dholms, devinivy, pfrazee |

## Links

- npm: https://www.npmjs.com/package/@atproto/identifier
- Repository: https://github.com/bluesky-social/atproto
- Homepage: https://github.com/bluesky-social/atproto#readme
- Issues: https://github.com/bluesky-social/atproto/issues
- npm.io page: https://npm.io/package/@atproto/identifier

## Dependencies (1)

- [@atproto/syntax](https://npm.io/package/@atproto/syntax.md) ^0.1.1

## Recent versions

- 0.2.1 (latest) — 2023-09-15
- 0.2.0 — 2023-07-06
- 0.1.0 — 2023-03-31

## README

# Identifier

Validation logic for AT identifiers - DIDs & Handles

## Usage

```typescript
import * as identifier from '@atproto/identifier'

isValidHandle('alice.test') // returns true
ensureValidHandle('alice.test') // returns void

isValidHandle('al!ce.test') // returns false
ensureValidHandle('al!ce.test') // throws

ensureValidDid('did:method:val') // returns void
ensureValidDid(':did:method:val') // throws
```

## License

MIT

---
_Source: https://npm.io/package/@atproto/identifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
