Richtlinie
Tutorial zum Soziallogin
Mit @capgo/capacitor-social-login verwenden
Alle Soziallogins in einer Plugin für Web, iOS und Android. Es unterstützt Google, Apple, Facebook, Twitter/X und generische OAuth2/OIDC-Anbieter wie GitHub, Microsoft Entra ID, Auth0, Okta und Keycloak.
Installieren
npm install @capgo/capacitor-social-login
npx cap sync
Was dieses Plugin enthält
initialize- Das Plugin initialisieren.login- Mit dem ausgewählten Anbieter anmelden.logout- Abmelden.isLoggedIn- Ist angemeldet.
Beispielische Verwendung
initialize
Initialisieren Sie das Plugin.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({} as InitializeOptions);
login
Melden Sie sich mit dem ausgewählten Anbieter an.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.login({} as Extract<LoginOptions, { provider: T }>);
logout
Abmelden.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.logout({} as {
provider: 'apple' | 'google' | 'facebook' | 'twitter' | 'oauth2';
providerId?: string;
});
isLoggedIn
Ist angemeldet.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.isLoggedIn({} as isLoggedInOptions);
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-social-login/
- Dokumentation: /docs/plugins/social-login/
Fortsetzen Sie bei Using @capgo/capacitor-social-login
Wenn Sie Mit @capgo/capacitor-social-login planen Sie die Authentifizierung und die Kontoflows, verbinden Sie es mit @capgo/capacitor-social-login für die Implementierungsdetails in @capgo/capacitor-social-login, Einstieg für die Implementierungsdetails in Einstieg, @capgo/capacitor-passkey für die Implementierungsdetails in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric für die Implementierungsdetails in @capgo/capacitor-native-biometric, und Zwei-Faktor-Authentifizierung Für die Implementierungsdetails in der Zwei-Faktor-Authentifizierung.