npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@capawesome/capacitor-password-autofill

v0.1.1

Published

Capacitor plugin for saving passwords to the platform credential store on Android and iOS.

Readme

Capacitor Password Autofill Plugin

Capacitor plugin for saving passwords to the platform credential store.

This plugin lets you save into the platform autofill system (iCloud Keychain on iOS, Google Password Manager on Android) after a successful in-app login. It does not fill forms — it solves the well-known problem that WebView-based apps never trigger the native "Save password?" prompt.

Features

The Capacitor Password Autofill plugin is one of the most complete credential saving solutions for Capacitor apps. Here are some of the key features:

  • 🖥️ Cross-platform: Supports Android and iOS.
  • 🔐 Credential saving: Save a username and password to the platform credential store.
  • 🎯 Deterministic: Trigger the save prompt explicitly after a successful login, even for non-form flows.
  • 📦 CocoaPods & SPM: Supports CocoaPods and Swift Package Manager for iOS.
  • 🔁 Up-to-date: Always supports the latest Capacitor version.

Missing a feature? Just open an issue and we'll take a look!

Use Cases

The Password Autofill plugin is typically used whenever an app wants credentials to end up in the platform credential store, for example:

  • Save credentials after login: Trigger the native "Save password?" prompt after a successful in-app login, which WebView-based apps never trigger on their own.
  • Single-page app logins: Save credentials for login flows based on fetch() and preventDefault(), which the operating system's form heuristics never detect.
  • Generated passwords: Save automatically generated passwords, for example during a social signup flow without a login form.
  • Smoother re-logins: Credentials saved to iCloud Keychain or Google Password Manager can be offered to the user again on future sign-ins.

Compatibility

| Plugin Version | Capacitor Version | Status | | -------------- | ----------------- | -------------- | | 0.x.x | >=8.x.x | Active support |

Installation

You can use our AI-Assisted Setup to install the plugin. Add the Capawesome Skills to your AI tool using the following command:

npx skills add capawesome-team/skills --skill capacitor-plugins

Then use the following prompt:

 Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-password-autofill` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

npm install @capawesome/capacitor-password-autofill
npx cap sync

This plugin is only available on Android and iOS. On Web, all methods reject as unimplemented.

Android

Variables

This plugin will use the following project variables (defined in your app's variables.gradle file):

  • $androidxCredentialsVersion version of androidx.credentials:credentials and androidx.credentials:credentials-play-services-auth (default: 1.5.0)

No further setup is required. On Android, saving a credential presents the system "Save password?" prompt provided by the active credential provider (e.g. Google Password Manager).

iOS

The Shared Web Credentials API requires the Associated Domains capability and a matching apple-app-site-association (AASA) file. Without this setup, savePassword(...) cannot save the credential.

Associated Domains

Add the Associated Domains entitlement to your app and include a webcredentials: entry for each domain you want to save credentials for:

<key>com.apple.developer.associated-domains</key>
<array>
  <string>webcredentials:example.com</string>
</array>

The domain you pass to savePassword(...) must match one of these entries (without the webcredentials: prefix).

Apple App Site Association

Host an apple-app-site-association file at https://example.com/.well-known/apple-app-site-association that lists your app under the webcredentials service:

{
  "webcredentials": {
    "apps": ["TEAMID.com.example.app"]
  }
}

Replace TEAMID with your Apple Developer Team ID and com.example.app with your app's bundle identifier. See the Apple documentation for more information.

Configuration

No configuration required for this plugin.

Usage

The following example shows how to save a username and password to the platform credential store.

Save a username and password

Call savePassword(...) after a successful login to save the credential to the platform credential store. On iOS, the domain is required and must match one of the domains in your app's Associated Domains entitlement (see Installation). On Android, the system "Save password?" prompt is presented to the user:

import { PasswordAutofill } from '@capawesome/capacitor-password-autofill';

const savePassword = async () => {
  await PasswordAutofill.savePassword({
    domain: 'example.com',
    username: '[email protected]',
    password: 'super-secret',
  });
};

API

savePassword(...)

savePassword(options: SavePasswordOptions) => Promise<void>

Save a username and password to the platform credential store.

On iOS, the credential is saved to the iCloud Keychain via the Shared Web Credentials API. This requires the Associated Domains entitlement with a webcredentials: entry and a matching apple-app-site-association file hosted on your domain.

On Android, the credential is saved to the Google Password Manager (or another provider) via the Credential Manager API. This presents the system "Save password?" prompt to the user.

Only available on Android and iOS.

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | SavePasswordOptions |

Since: 0.1.0


Interfaces

SavePasswordOptions

| Prop | Type | Description | Since | | -------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | | domain | string | The domain to associate the credential with. This must match one of the domains in your app's Associated Domains entitlement (without the webcredentials: prefix). Only available on iOS (required). | 0.1.0 | | password | string | The password to save. | 0.1.0 | | username | string | The username to save. | 0.1.0 |

When to use this plugin vs. the official guide

The official Capacitor autofill guide saves credentials by relying on the operating system's form heuristics. This requires changing server.hostname to your real domain, which:

  • changes the WebView origin and therefore wipes existing users' localStorage, IndexedDB, and cookies, and
  • can break OAuth redirect allowlists.

It also depends on iOS detecting a form submission followed by a navigation — something typical single-page app logins (fetch() + preventDefault()) never trigger.

This plugin takes a different approach: deterministic credential saving without changing the WebView origin. Your app keeps localhost as its origin, and you call savePassword(...) explicitly after a successful login. This also covers non-form flows such as social signup with generated passwords.

What this plugin does not replace:

  • The Associated Domains / apple-app-site-association setup is required in both approaches.
  • Autofill (reading credentials back into a form) still benefits from the autocomplete attributes described in the official guide.

FAQ

How is this plugin different from other similar plugins?

It saves credentials into the platform credential store — iCloud Keychain on iOS and Google Password Manager on Android — with an explicit savePassword(...) call after a successful login. Because saving is triggered by an explicit call, it reliably covers single-page app logins built on fetch() and preventDefault() as well as non-form flows such as social signups with generated passwords, all without changing your WebView origin. The API is fully typed, supports both CocoaPods and Swift Package Manager on iOS, and is actively maintained against the latest Capacitor version.

Does this plugin fill login forms with saved credentials?

No, this plugin only saves credentials into the platform autofill system (iCloud Keychain on iOS, Google Password Manager on Android). Filling credentials back into a form is handled by the operating system and still benefits from the autocomplete attributes described in the official Capacitor autofill guide.

Why is the credential not saved on iOS?

The Shared Web Credentials API requires the Associated Domains capability with a webcredentials: entry and a matching apple-app-site-association file hosted on your domain. Without this setup, savePassword(...) cannot save the credential. Also make sure that the domain option matches one of the entries in your entitlement (without the webcredentials: prefix). See the Installation section for the details.

Do I need to pass the domain option on Android?

No, the domain option is only used on iOS, where it is required and must match one of the domains in your app's Associated Domains entitlement. On Android, the credential is saved via the Credential Manager API without a domain.

How is this plugin different from the official Capacitor autofill guide?

The official guide relies on the operating system's form heuristics, which requires changing server.hostname to your real domain. This changes the WebView origin, wipes existing users' localStorage, IndexedDB, and cookies, and can break OAuth redirect allowlists. This plugin instead saves credentials deterministically with an explicit savePassword(...) call, so your app keeps localhost as its origin. See the comparison section above for more details.

Is this plugin available on the web?

No, this plugin is only available on Android and iOS. On the web, all methods reject as unimplemented.

Can I use this plugin with Ionic, React, Vue or Angular?

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

Related Plugins

  • Passkeys: Create and authenticate with passkeys based on the WebAuthn standard.
  • Biometrics: Request biometric authentication, such as face or fingerprint recognition.
  • Secure Preferences: Securely store key/value pairs such as passwords, tokens or other sensitive information.

Newsletter

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our Capawesome Newsletter.

Changelog

See CHANGELOG.md.

License

See LICENSE.