Zum Inhalt springen

Erste Schritte

GitHub

Du kannst unser KI-gestütztes Setup nutzen, um das Plugin zu installieren. Füge deinem KI-Tool die Capgo Skills mit folgendem Befehl hinzu:

Terminalfenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Nutze anschließend diesen Prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-autofill-save-password` plugin in my project.

Wenn du ein manuelles Setup bevorziehst, installiere das Plugin mit den folgenden Befehlen und befolge die plattformspezifischen Anweisungen unten:

Terminalfenster
bun add @capgo/capacitor-autofill-save-password
bunx cap sync
import { SavePassword } from '@capgo/capacitor-autofill-save-password';

After login succeeds, offer to save credentials the OS can autofill later.

import { SavePassword } from '@capgo/capacitor-autofill-save-password';
await SavePassword.promptDialog({
username: email,
password,
});
const { username, password } = await SavePassword.readPassword();
  • Aufrufzeitpunkt: Prompt erst nach erfolgreicher Authentifizierung des Nutzers, nicht bei jedem Tastendruck.
  • Web: Nutze stattdessen den Passwort-Manager des Browsers; dieses Plugin ist nur für Native verfügbar.
  • iOS Credential Provider: Das Verhalten unter iOS 26.2+ folgt dem vom Nutzer gewählten Passwort-Manager.

Ein Passwort im Keychain speichern.

import { SavePassword } from '@capgo/capacitor-autofill-save-password';
await SavePassword.promptDialog({
username: 'your-username',
password: 'your-password'
});

Ein Passwort aus dem Keychain lesen. Erfordert die Einrichtung einer Associated Domain für die App unter iOS.

import { SavePassword } from '@capgo/capacitor-autofill-save-password';
const result = await SavePassword.readPassword();
// The result holds sensitive values: use it without logging it.
export interface Options {
/**
* The username to save.
*/
username: string;
/**
* The password to save.
*/
password: string;
/**
* The url to save the password for. (For example: "console.capgo.app")
* iOS only.
*/
url?: string;
}
export interface ReadPasswordResult {
/**
* The username of the password.
*/
username: string;
/**
* The password of the password.
*/
password: string;
}

Diese Seite wird aus dem Plugin- src/definitions.ts. Führe den Sync erneut aus, wenn sich der öffentliche API upstream ändert.

Wenn Sie ... verwenden Erste Schritte um Authentifizierungs- und Account-Flows zu planen, verbinde es mit Verwendung von @capgo/capacitor-autofill-save-password für die native Funktion in der Verwendung von @capgo/capacitor-autofill-save-password, @capgo/capacitor-social-login für das Implementierungsdetail in @capgo/capacitor-social-login, @capgo/capacitor-passkey für das Implementierungsdetail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric für das Implementierungsdetail in @capgo/capacitor-native-biometric, und Zwei-Faktor-Authentifizierung für das Implementierungsdetail in der Zwei-Faktor-Authentifizierung.