# @react-native/assets-registry

> Asset support code for React Native.

Latest version **0.87.1** (published 2026-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @react-native/assets-registry
pnpm add @react-native/assets-registry
yarn add @react-native/assets-registry
bun add @react-native/assets-registry
```

## Health

**Score 73/100 (B)** — status: active.

Positive: has types package; no vulnerabilities; has provenance; recently updated; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.87.1 |
| Published | 2026-08-26 |
| First published | 2022-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/react-native__assets-registry) |
| Module format | CommonJS |
| Node | ^22.13.0 \|\| ^24.3.0 \|\| >= 26.0.0 |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 126431 |
| Maintainers | react-native-bot, fb |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/@react-native/assets-registry
- Repository: https://github.com/react/react-native
- Homepage: https://github.com/react/react-native/tree/HEAD/packages/assets-registry#readme
- Issues: https://github.com/react/react-native/issues
- npm.io page: https://npm.io/package/@react-native/assets-registry

## Recent versions

- 0.87.1 (latest) — 2026-08-26
- 0.89.0-nightly-20260917-76ca12ba5 (nightly) — 2026-09-17
- 0.88.0-rc.1 (next) — 2026-09-15
- 0.86.3 (0.86-stable) — 2026-08-24
- 0.83.10 (0.83-stable) — 2026-06-25
- 0.81.6 (0.81-stable) — 2026-02-05
- 0.80.3 (0.80-stable) — 2026-01-26
- 0.79.7 (0.79-stable) — 2025-10-21
- 0.77.3 (0.77-stable) — 2025-07-21
- 0.78.3 (0.78-stable) — 2025-07-09
- 0.76.9 (0.76-stable) — 2025-04-03
- 0.75.5 (0.75-stable) — 2025-02-06
- 0.74.89 (0.74-stable) — 2025-01-27
- 0.74.82 (false) — 2024-05-01
- 0.89.0-nightly-20260916-0c35f5744 — 2026-09-16
- … 1144 more at https://npm.io/package/@react-native/assets-registry/versions

## README

# @react-native/assets-registry

![npm package](https://img.shields.io/npm/v/@react-native/assets-registry?color=brightgreen&label=npm%20package)

> [!Warning]
> **This package is deprecated (since 0.87)** and will be removed in a future release. Use [`AssetRegistry`](https://reactnative.dev/docs/assetregistry) from `react-native` (or the `react-native/asset-registry` build entry point) instead of `@react-native/assets-registry/registry`, and [`@react-native/asset-utils`](https://www.npmjs.com/package/@react-native/asset-utils) instead of `@react-native/assets-registry/path-support`.

Runtime registry that maps asset IDs generated in a Metro bundle to asset metadata. It backs `<Image>`, `Image.resolveAssetSource()`, and any code that resolves `require('./img.png')` on native.

Most apps never import this directly — assets are handled through `<Image>`.

## API

### `@react-native/assets-registry/registry` (DEPRECATED)

> [!Warning]
> **Deprecated**: Aliases to [`AssetRegistry`](https://reactnative.dev/docs/assetregistry) (since 0.87).
>
> Please use:
> - `import { AssetRegistry } from 'react-native';` (apps/library code)
> - `'react-native/asset-registry'` (entrypoint for Metro/build configs)

| Export | Signature | Notes |
|---|---|---|
| `registerAsset` | `(asset: PackagerAsset) => number` | Stores the asset; returns a numeric ID |
| `getAssetByID` | `(assetId: number) => PackagerAsset` | Looks an asset back up by ID |

### `@react-native/assets-registry/path-support` (DEPRECATED)

> [!Warning]
> **Deprecated**: Use [`@react-native/asset-utils`](https://www.npmjs.com/package/@react-native/asset-utils) (since 0.87).

Android resource-path helpers, used when copying assets into `drawable-*` folders.

| Export | Signature | Notes |
|---|---|---|
| `getAndroidResourceFolderName` | `(asset: PackagerAsset, scale: number) => string` | e.g. `drawable-xhdpi`; non-drawable types resolve to `raw` |
| `getAndroidResourceIdentifier` | `(asset: PackagerAsset) => string` | Sanitised resource name |
| `getBasePath` | `(asset: PackagerAsset) => string` | `httpServerLocation` without the leading slash |

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