Skip to main content
@capgo/capacitor-permissions Device APIs Open source

Permissions Capacitor plugin

Check and request runtime permissions on iOS, Android, and web with one PermissionName enum and normalized status codes

Install

bun add @capgo/capacitor-permissions bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-permissions
  • pnpm add @capgo/capacitor-permissions
  • yarn add @capgo/capacitor-permissions

Guide

How to use Permissions in Capacitor

Using @capgo/capacitor-permissions

One TypeScript API to check and request runtime permissions on iOS, Android, and web with normalized status codes.

Install

bun add @capgo/capacitor-permissions
bunx cap sync

What This Plugin Exposes

  • check - Read the current status of one permission without prompting.
  • request - Request one permission from the user.
  • checkMultiple - Check several permissions without prompting.
  • requestMultiple - Request several permissions sequentially.
  • shouldShowRationale - Whether Android should show a rationale before requesting again.
  • openSettings - Open application or notification settings when access is blocked.
  • requestPreciseLocation - Upgrade to precise location on iOS and fine location on Android.
  • getPluginVersion - Returns the platform implementation version marker.

Example Usage

check and request

import { Permissions } from '@capgo/capacitor-permissions';

export async function ensureCamera(): Promise<boolean> {
  const { status } = await Permissions.check({ permission: 'camera' });
  if (status === 'granted') return true;
  const { status: afterRequest } = await Permissions.request({ permission: 'camera' });
  return afterRequest === 'granted';
}

openSettings

import { Permissions } from '@capgo/capacitor-permissions';

document.getElementById('camera-settings')?.addEventListener('click', async () => {
  const { status } = await Permissions.check({ permission: 'camera' });
  if (status === 'blocked') {
    await Permissions.openSettings({ type: 'application' });
  }
});

Full Reference

FAQ

Permissions plugin FAQ

How do I install the Permissions plugin in a Capacitor app?

Run "bun add @capgo/capacitor-permissions" (or "npm install @capgo/capacitor-permissions"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-permissions" in your app code.

Does @capgo/capacitor-permissions work with React, Vue and Angular?

Yes. Permissions is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-permissions support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-permissions free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-permissions/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Permissions without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Permissions changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo