Skip to main content
@capgo/capacitor-app-intents UI & System Open source

App Intents Capacitor plugin

Ship Siri phrases, Shortcuts, Spotlight, Home Screen quick actions, and App Intents entity catalogs from Capacitor without rebuilding your web layer for every action

Install

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

Guide

How to use App Intents in Capacitor

Using @capgo/capacitor-app-intents

Capgo App Intents plugin interface.

Install

bun add @capgo/capacitor-app-intents
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

API at a glance

Method Description
getPendingInvocations Return invocations queued before JavaScript was ready.
removePendingInvocation Remove one pending invocation after your handler processes it.
setEntityCatalog Persist an entity catalog for a given type string.
setHomeScreenShortcutItems Replace Home Screen quick actions (UIApplicationShortcutItems).
indexSpotlightEntities Index Spotlight items for your app domain.
removeSpotlightEntities Remove Spotlight items by id.
performAppleSchemaTemplate Queue a JavaScript handler for an alpha Apple schema template.

Examples

getPendingInvocations()

Return invocations queued before JavaScript was ready.

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

const result = await CapgoAppIntents.getPendingInvocations();
console.log(result);

removePendingInvocation()

Remove one pending invocation after your handler processes it.

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

await CapgoAppIntents.removePendingInvocation({ id: 'id-123' });

setEntityCatalog()

Persist an entity catalog for a given type string.

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

await CapgoAppIntents.setEntityCatalog({
  type: 'type',
  entries: [
    {
      id: 'id-123',
      title: 'Hello from Capacitor',
    },
  ],
});

setHomeScreenShortcutItems()

Replace Home Screen quick actions (UIApplicationShortcutItems).

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

await CapgoAppIntents.setHomeScreenShortcutItems({
  items: [
    {
      type: 'type',
      title: 'Hello from Capacitor',
    },
  ],
});

indexSpotlightEntities()

Index Spotlight items for your app domain.

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

await CapgoAppIntents.indexSpotlightEntities({
  entities: [
    {
      id: 'id-123',
      title: 'Hello from Capacitor',
      actionName: 'action',
    },
  ],
});

removeSpotlightEntities()

Remove Spotlight items by id.

import { CapgoAppIntents } from '@capgo/capacitor-app-intents';

await CapgoAppIntents.removeSpotlightEntities({ ids: ['ids'] });

The table above lists the 7 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Listen to events

addListener returns a handle. Call handle.remove() when the screen unmounts, or CapgoAppIntents.removeAllListeners() to clear every listener.

Full reference

FAQ

App Intents plugin FAQ

How do I install the App Intents plugin in a Capacitor app?

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

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

Yes. App Intents 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-app-intents 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-app-intents free and open source?

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

Can I update code that uses App Intents 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 App Intents 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