@capacitor/app

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

Library
npm
v8.1.1
674stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
83/100Excellent
Development Activity76
Maintenance84
Community84
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture76
Code Quality75
Innovation62
Learning Curve80

@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 5 apps in this directory

TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

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
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
75%
GPL 3.0

Bramble

Password Manager · Security · Authentication

315

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
73
Repo Health
84
Technical
72
Dependency
Built with
TypeScript75%
Updated today
Clojure
73%
AGPL 3.0

Logseq

Note Taking · Knowledge Management

44,506

A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.

View details
92
Repo Health
82
Technical
68
Dependency
Built with
Clojure73%
OCaml11%
Updated today
TypeScript
71%
Apache 2.0

Supabase

Developer Tools · Databases · Search

108,148

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
66
Dependency
Built with
TypeScript71%
MDX26%
Updated today
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

21,443

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
90
Repo Health
81
Technical
73
Dependency
Built with
TypeScript91%
Updated 2 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

Search