# @portkey/mobile-provider

> @portkey/m

Latest version **2.5.0-alpha.6** (published 2025-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @portkey/mobile-provider
pnpm add @portkey/mobile-provider
yarn add @portkey/mobile-provider
bun add @portkey/mobile-provider
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.5.0-alpha.6 |
| Published | 2025-10-22 |
| First published | 2023-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 42.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | potterp, yellow.m, frankportkey, codingwizard-portkey, aurora_v5_ptk, carbon-lv, sarah999, portkey-zz |

## Links

- npm: https://www.npmjs.com/package/@portkey/mobile-provider
- Repository: https://github.com/Portkey-Wallet/portkey-providers
- Homepage: https://portkey.finance/
- Issues: https://github.com/Portkey-Wallet/portkey-providers/issues
- npm.io page: https://npm.io/package/@portkey/mobile-provider

## Recent versions

- 2.5.0-alpha.6 (latest) — 2025-10-22
- 2.5.0-alpha.5 — 2025-10-22
- 2.5.0-alpha.4 — 2025-09-29
- 2.5.0-alpha.3 — 2025-09-25
- 2.5.0-alpha.2 — 2025-09-24
- 2.5.0-alpha.1 — 2025-09-23
- 2.5.0-alpha.0 — 2025-09-22
- 2.4.2-alpha.3 — 2025-08-13
- 2.4.2-alpha.2 — 2025-08-13
- 2.4.2-alpha.1 — 2025-08-11
- 2.4.1-alpha.3 — 2025-08-01
- 2.4.0-alpha.12 — 2025-03-11
- 2.4.0-alpha.11 — 2025-03-11
- 2.4.0-alpha.10 — 2025-03-07
- 2.4.0-alpha.9 — 2025-01-23
- … 63 more at https://npm.io/package/@portkey/mobile-provider/versions

## README

<p align="center">
  <a href="https://portkeydocs.readthedocs.io/en/pre-release/PortkeyDIDSDK/index.html">
    <img width="200" src= "https://raw.githubusercontent.com/Portkey-Wallet/portkey-web/master/logo.png"/>
  </a>
</p>
<h1 align="center">@portkey/mobile-provider</h1>

- [__Usage__](#usage)
  - [1. Use @portkey/detect-provider](#1-use-portkeydetect-provider)
  - [2. Detect mobile-provider by your own code (not recommended)](#2-detect-mobile-provider-by-your-own-code-not-recommended)

This project creates javascript code that will be injected into Portkey Extension's WebView environment, for providing basic functions for DApp developers.

# __Usage__

## 1. Use @portkey/detect-provider

We recommend to use the __[@portkey/detect-provider](../detect-provider/README.md)__ package to detect if Portkey is injected.  
Click the link above to learn more.  

## 2. Detect mobile-provider by your own code (not recommended)

__mobile-provider__ will be injected to the `window` or `globalThis.window` object, providing you a way to detect it directly.  
Also, when __mobile-provider__ is injected, an event named `portkeyInitEvent` will be triggered on the host object (`window`).

```typescript
const detectedProvider:MobileProvider = window.portkey;
if(!detectedProvider){
    // Portkey is not injected yet
    window.addEventListener('portkeyInitEvent', ()=>{
      const provider = window.portkey;
      // Do something with the provider
      ...
    });
  }
```

You can find more details and examples in __[@portkey/detect-provider](../detect-provider/README.md)__ 's README doc.

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