@capacitor/app

The official Capacitor plugin for app lifecycle events, deep links, and app state

Library
npm
v8.1.1
679 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
84 /100 Excellent
Development Activity 80
Maintenance 84
Community 84
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
73 /100 Good
Architecture 76
Code Quality 75
Innovation 62
Learning Curve 80

@capacitor/app is one of Ionic’s official Capacitor plugins, part of the capacitor-plugins monorepo alongside action-sheet, browser, clipboard, device, dialog, network, share, splash-screen, and status-bar. It handles high-level application state and lifecycle events — emitting events when the app enters or leaves the foreground, handling incoming deep links (universal links / app links), opening other installed apps, and exposing persisted plugin state — through a single consistent JS API backed by native Swift and Java/Kotlin implementations.

Because nearly every Capacitor app needs to react to backgrounding, resuming, or deep-link URLs, @capacitor/app is one of the most consistently installed plugins in the ecosystem, making it a representative entry point into how Capacitor’s official plugin packages are structured, tested, and released as a monorepo of independently versioned npm packages.

What You Get

  • App.addListener(‘appStateChange’, …) to react when the app enters or leaves the foreground
  • App.addListener(‘appUrlOpen’, …) to handle incoming deep links and universal/app links
  • App.addListener(‘backButton’, …) to intercept Android’s hardware back button
  • App.exitApp() and App.minimizeApp() to programmatically control the app’s foreground state
  • App.getState() and App.getLaunchUrl() for reading current state and how the app was launched
  • Native Swift and Java/Kotlin implementations behind a single consistent TypeScript API

Common Use Cases

  • Pausing video playback, timers, or network polling when the app is backgrounded and resuming on foreground
  • Routing users to the correct in-app screen when the app is opened via a deep link or universal link
  • Overriding Android’s hardware back-button behavior to navigate within a single-page app instead of exiting
  • Persisting and restoring UI or session state around app termination and relaunch

Under The Hood

Architecture: @capacitor/app follows the standard Capacitor plugin structure — src/definitions.ts declares the TypeScript interface, src/web.ts implements a browser fallback where native APIs don’t apply, and platform-native code (ios/Sources in Swift, android/src in Java/Kotlin) implements the actual OS-level hooks (UIApplication lifecycle delegates on iOS, Activity lifecycle callbacks on Android) that get bridged back to JS listeners registered via Capacitor’s core plugin event system.

Tech Stack: The monorepo spans Java (46%, Android plugin implementations), Swift (27%, iOS plugin implementations), and TypeScript (22%, shared JS API layer), managed with Nx and Lerna for versioning and cross-package builds, with each plugin (including app) shipping its own LICENSE, podspec, and Gradle build file so plugins can be installed and updated independently.

Code Quality: Each plugin directory, including app, ships its own ios/Tests directory for native test coverage alongside the shared TypeScript definitions; the monorepo has 88 contributors and releases roughly 1.4 times per week across its packages, with CI running per-platform builds (Ruby-based fastlane/cocoapods tooling appears in the release_frequency-driving workflows) before publishing.

API Design: The plugin’s public API is a small set of listener registrations and imperative methods (getState, getLaunchUrl, exitApp, minimizeApp) that follows the same addListener/removeAllListeners pattern used across every other official Capacitor plugin, so once a developer learns one plugin’s API shape, @capacitor/app requires no additional conceptual overhead.

Used by 31 apps in this directory

TypeScript
95%
MIT

Actual

Invoicing Finance

29,186

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
73
Dependency
Built with
TypeScript 95%
Updated 4 days ago
TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers