# @dfinity/principal

> JavaScript and TypeScript library to work with Internet Computer principals

Latest version **3.4.3** (published 2025-11-19) · Apache-2.0 license · 0 weekly downloads

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

## Install

```sh
npm install @dfinity/principal
pnpm add @dfinity/principal
yarn add @dfinity/principal
bun add @dfinity/principal
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.4.3 |
| Published | 2025-11-19 |
| First published | 2021-06-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 78.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 171 |
| Author | DFINITY Stiftung |
| Maintainers | dayyildiz, npm-dfinity-org, bitdivine, ielashi, keplervital, dfn_wndlng, dfn-it-owner, g.perez |
| Keywords | internet computer, ic, dfinity, canister, webauthn, identity, principal, dfx, candid, motoko, javascript, typescript, blockchain, crypto, distributed, api |

## Links

- npm: https://www.npmjs.com/package/@dfinity/principal
- Repository: https://github.com/dfinity/icp-js-core
- Homepage: https://js.icp.build/core/v3.2/libs/principal
- Issues: https://github.com/dfinity/icp-js-core/issues
- npm.io page: https://npm.io/package/@dfinity/principal

## Dependencies (1)

- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^1.8.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 3.4.3 (latest) — 2025-11-19
- 3.2.0-beta.0 (beta) — 2025-07-31
- 0.19.3-react-native (react-native) — 2023-11-09
- 3.4.2 — 2025-11-10
- 3.4.1 — 2025-10-24
- 3.4.0 — 2025-10-22
- 3.3.1 — 2025-10-21
- 3.3.0 — 2025-10-13
- 3.2.7 — 2025-09-30
- 3.2.6 — 2025-09-18
- 3.2.5 — 2025-09-16
- 3.2.4 — 2025-09-02
- 3.2.3 — 2025-08-27
- 3.2.2 — 2025-08-21
- 3.2.1 — 2025-08-13
- … 82 more at https://npm.io/package/@dfinity/principal/versions

## README

# @icp-sdk/core/principal

JavaScript and TypeScript module to work with Internet Computer Principals.

## Usage

```ts
import { Principal } from '@icp-sdk/core/principal';

const canisterId = Principal.fromText('uqqxf-5h777-77774-qaaaa-cai');
const anonymousPrincipal = Principal.anonymous();
```

## API Reference

Additional API Documentation can be found [here](https://js.icp.build/core/latest/libs/principal/api/).

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