Skip to content

Getting Started

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Terminal window
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-permissions` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

Terminal window
npm install @capgo/capacitor-permissions
npx cap sync
import { Permissions } from '@capgo/capacitor-permissions';
  • iOS setup for Info.plist usage strings per PermissionName.
  • Android setup for uses-permission entries and minSdk 24.
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';
}

When status is blocked, send the user to settings:

await Permissions.openSettings({ type: 'application' });