npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@m430/capacitor-app-install

v0.0.3

Published

Capacitor plugin for APK installation and permission management - Android only (Web and iOS not supported)

Readme

@m430/capacitor-app-install

Android Only - A Capacitor plugin for APK installation and permission management on Android devices. This plugin provides essential functionality for app installation, including permission checks and APK installation capabilities.

⚠️ Platform Support: This plugin only supports Android. iOS and Web platforms are not supported.

Features

  • ✅ Check install unknown apps permission
  • ✅ Open install unknown apps settings
  • ✅ Install APK files
  • ✅ Android only (Web and iOS platforms not supported)
  • ✅ TypeScript support

Install

npm install @m430/capacitor-app-install
npx cap sync

Android Configuration

1. Add FileProvider to AndroidManifest.xml

Add the following to your android/app/src/main/AndroidManifest.xml inside the <application> tag:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>

2. Create file_paths.xml

Create android/app/src/main/res/xml/file_paths.xml:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-path name="external_files" path="." />
    <external-cache-path name="external_cache" path="." />
    <files-path name="files" path="." />
    <cache-path name="cache" path="." />
</paths>

3. Add Permissions

Add the following permissions to your android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

Usage

import { AppInstallPlugin } from '@m430/capacitor-app-install';

// Check if app can install unknown apps
const { granted } = await AppInstallPlugin.canInstallUnknownApps();
if (!granted) {
  // Open settings to allow install from unknown sources
  await AppInstallPlugin.openInstallUnknownAppsSettings();
}

// Install APK
try {
  const result = await AppInstallPlugin.installApk({
    filePath: '/path/to/your/app.apk'
  });
  console.log('Installation result:', result.message);
  if (result.completed) {
    console.log('APK installation started successfully');
  }
} catch (error) {
  console.error('Failed to install APK:', error);
}

API

canInstallUnknownApps()

canInstallUnknownApps() => Promise<PermissionResult>

Check if the app can install unknown apps (install from unknown sources)

Returns: Promise<PermissionResult>


openInstallUnknownAppsSettings()

openInstallUnknownAppsSettings() => Promise<void>

Open the settings page for installing unknown apps


installApk(...)

installApk(options: InstallApkOptions) => Promise<InstallApkResult>

Install an APK file

| Param | Type | Description | | ------------- | --------------------------------------------------------------- | -------------------------------------- | | options | InstallApkOptions | - The options containing the file path |

Returns: Promise<InstallApkResult>


Interfaces

PermissionResult

| Prop | Type | Description | | ------------- | -------------------- | --------------------------------- | | granted | boolean | Whether the permission is granted |

InstallApkResult

| Prop | Type | Description | | --------------- | -------------------- | --------------------------------------------------- | | completed | boolean | Whether the installation was completed successfully | | message | string | Message describing the installation result |

InstallApkOptions

Capacitor App Install Plugin Definitions

⚠️ Platform Support: This plugin only supports Android platform. iOS and Web platforms are not supported.

| Prop | Type | Description | | -------------- | ------------------- | ----------------------------------- | | filePath | string | The file path of the APK to install |

Platform Support

| Platform | Supported | | -------- | --------- | | Android | ✅ | | iOS | ❌ | | Web | ❌ |

Error Handling

The plugin throws errors in the following cases:

  • File not found: When the specified APK file doesn't exist
  • Permission denied: When required permissions are not granted
  • Platform not supported: When called on non-Android platforms

License

MIT

Contributing

See CONTRIBUTING.md for details on how to contribute to this project.