Stop Rebuilding Your App for Every Platform: Capacitor Lets You Ship One Codebase Everywhere
You've built a beautiful web app. It works great in the browser. But now your boss wants it in the App Store, and suddenly you're staring down the barrel of learning Swift, Kotlin, and two completely different development ecosystems. Sound familiar? That's exactly the problem Capacitor from the Ionic Team was built to solve. It's a tool that lets you take the web app you already have and run it natively on iOS, Android, and the web—all from that same single codebase.
What It Does
Capacitor is essentially a cross-platform API and code execution layer that sits between your web code and the native operating systems. It provides a set of JavaScript APIs that let you call native SDKs directly from your web code, which means you can access device features like the camera, file system, or biometrics without writing platform-specific code yourself.
The architecture is straightforward. Your web app runs in a native web view on each platform, and Capacitor bridges the gap between that web view and the underlying native APIs. When you need something the web platform doesn't offer, you write a plugin. Capacitor comes with a dedicated Plugin API for building native plugins, and you can write these plugins either directly inside your Capacitor app or package them as npm dependencies for the community to use. On iOS, you'd use Swift; on Android, you'd use Kotlin or Java.
There's also first-class Progressive Web App support baked in. So the same app you deploy to the app stores can also be deployed to the mobile web as a PWA, without any extra work.
Why It's Cool
The most interesting thing about Capacitor isn't just that it exists—it's how it approaches the native side of things. Unlike some alternatives that treat native projects as opaque build artifacts you never touch, Capacitor treats them as source artifacts. That means the Android and iOS projects it generates are real, editable projects you can open in Android Studio or Xcode and modify directly when you need to. You're not locked into a black box.
Here's what stands out:
-
Drop-in by design. The README emphasizes that Capacitor was designed to work with any existing modern web app. You don't need to rewrite anything—you just add Capacitor to what you already have.
-
Cordova compatibility. If you're coming from the Cordova world, you're not starting from scratch. Capacitor offers backward compatibility with a vast majority of Cordova plugins, so your existing plugin ecosystem largely carries over.
-
No framework lock-in. You might assume a tool from the Ionic Team would require you to use Ionic Framework. It doesn't. The README is explicit: you don't need Ionic Framework or the Ionic CLI to use Capacitor. You can use it with React, Vue, vanilla JavaScript, or whatever you prefer. You'll just need to handle native UI and tooling configuration yourself.
-
Modern tooling approach. Capacitor takes a more contemporary approach to both tooling and plugin development compared to older solutions. It's not just a wrapper—it's a maintained project with an active community behind it.
-
Plugin distribution via npm. The ability to package plugins as npm dependencies is a nice touch. It means sharing native functionality with the community follows the same workflow you already use for sharing JavaScript packages.
How to Try It
Getting started is surprisingly painless, especially if you already have a web app. The commands are minimal:
npm install @capacitor/core @capacitor/cli
npx cap init
That initializes Capacitor in your existing project. Then you add the platforms you want to target:
npm install @capacitor/android
npx cap add android
npm install @capacitor/ios
npx cap add ios
If you're starting a brand new app from scratch, the README suggests using the Ionic Framework with Capacitor. You'd install the Ionic CLI globally and scaffold a new project with:
npm install -g @ionic/cli
ionic start --capacitor
The full documentation lives at capacitorjs.com/docs, and the repository is at github.com/ionic-team/capacitor if you want to dig into the source or contribute.
Final Thoughts
Capacitor is a pragmatic solution for a very real problem. If you're a web developer who needs to get into the native app space without learning entirely new languages and toolchains, it's worth a serious look. It's especially strong if you already have a web app in production and want to extend it to mobile without a full rewrite. The Cordova plugin compatibility and non-requirement of Ionic Framework make it a flexible choice rather than a proprietary lock-in. It's not going to replace native development for apps that need deep platform integration, but for the vast majority of web apps that just need a native shell and access to device APIs, it's a solid, honest tool that does exactly what it promises.
Follow @githubprojects for more developer tools and open source projects.