# @polkadot/extension-inject

> A generic injector (usable to any extension), that populates the base exposed interfaces to be used by dapps.

Latest version **0.63.1** (published 2026-03-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @polkadot/extension-inject
pnpm add @polkadot/extension-inject
yarn add @polkadot/extension-inject
bun add @polkadot/extension-inject
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.63.1 |
| Published | 2026-03-31 |
| First published | 2019-07-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 7 |
| Unpacked size | 28 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1021 |
| Author | Jaco Greeff |
| Maintainers | jacogr, polkadotjs, paritytech-ci |

## Links

- npm: https://www.npmjs.com/package/@polkadot/extension-inject
- Repository: https://github.com/polkadot-js/extension
- Homepage: https://github.com/polkadot-js/extension/tree/master/packages/extension-inject#readme
- Issues: https://github.com/polkadot-js/extension/issues
- npm.io page: https://npm.io/package/@polkadot/extension-inject

## Dependencies (7)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [@polkadot/api](https://npm.io/package/@polkadot/api.md) ^16.5.6
- [@polkadot/util](https://npm.io/package/@polkadot/util.md) ^14.0.3
- [@polkadot/types](https://npm.io/package/@polkadot/types.md) ^16.5.6
- [@polkadot/x-global](https://npm.io/package/@polkadot/x-global.md) ^14.0.3
- [@polkadot/util-crypto](https://npm.io/package/@polkadot/util-crypto.md) ^14.0.3
- [@polkadot/rpc-provider](https://npm.io/package/@polkadot/rpc-provider.md) ^16.5.6

## Recent versions

- 0.63.1 (latest) — 2026-03-31
- 0.44.2-4 (beta) — 2022-06-21
- 0.62.6 — 2025-11-26
- 0.62.5 — 2025-11-17
- 0.62.4 — 2025-11-13
- 0.62.3 — 2025-10-23
- 0.62.2 — 2025-10-09
- 0.62.1 — 2025-09-25
- 0.61.7 — 2025-08-28
- 0.61.6 — 2025-08-14
- 0.61.5 — 2025-07-30
- 0.61.4 — 2025-07-17
- 0.61.3 — 2025-07-08
- 0.61.2 — 2025-07-04
- 0.61.1 — 2025-06-27
- … 605 more at https://npm.io/package/@polkadot/extension-inject/versions

## README

# @polkadot/extension-inject

This is a basic extension injector that manages access to the global objects available. As an extension developer, you don't need to manage access to the window object manually, by just calling  enable here, the global object is setup and managed properly. From here any dapp can access it with the `@polkadot/extension-dapp` package;

## Usage

```js
import { injectExtension } from '@polkadot/extension-inject';

// this a the function that will be exposed to be callable by the dapp. It resolves a promise
// with the injected interface, (see `Injected`) when the dapp at `originName` (url) is allowed
// to access functionality
function enableFn (originName: string): Promise<Injected> {
  ...
}

// injects the extension into the page
injectExtension(enableFn, { name: 'myExtension', version: '1.0.1' });
```

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