Skip to main content
Back to plugins
@capgo/capacitor-widget-kit
Tutorial
by github.com/Cap-go

Widget Kit

Build iOS widgets and Live Activities from Capacitor with SVG templates, timers, and action hotspots

Guide

Tutorial on Widget Kit

Using @capgo/capacitor-widget-kit

Capacitor bridge for an iOS-first WidgetKit / Live Activities plugin.

Install

bun add @capgo/capacitor-widget-kit
bunx cap sync

What This Plugin Exposes

  • areActivitiesSupported - Check whether the native template activity bridge can run on the current device.
  • startTemplateActivity - Persist a generic SVG template activity and start the matching native Live Activity bridge.
  • updateTemplateActivity - Replace part or all of the stored activity definition/state.
  • endTemplateActivity - End a running activity while optionally persisting one last state snapshot.

Example Usage

areActivitiesSupported

Check whether the native template activity bridge can run on the current device.

import { CapgoWidgetKit } from '@capgo/capacitor-widget-kit';

await CapgoWidgetKit.areActivitiesSupported();

startTemplateActivity

Persist a generic SVG template activity and start the matching native Live Activity bridge.

import { CapgoWidgetKit } from '@capgo/capacitor-widget-kit';

await CapgoWidgetKit.startTemplateActivity({} as StartTemplateActivityOptions);

updateTemplateActivity

Replace part or all of the stored activity definition/state.

import { CapgoWidgetKit } from '@capgo/capacitor-widget-kit';

await CapgoWidgetKit.updateTemplateActivity({} as UpdateTemplateActivityOptions);

endTemplateActivity

End a running activity while optionally persisting one last state snapshot.

import { CapgoWidgetKit } from '@capgo/capacitor-widget-kit';

await CapgoWidgetKit.endTemplateActivity({} as EndTemplateActivityOptions);

Full Reference