GitHub
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Overview
Section titled “Overview”GitHub is supported through the built-in generic oauth2 provider.
Example
Section titled “Example”import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({ oauth2: { github: { appId: 'your-github-client-id', authorizationBaseUrl: 'https://github.com/login/oauth/authorize', accessTokenEndpoint: 'https://github.com/login/oauth/access_token', redirectUrl: 'myapp://oauth/github', scope: 'read:user user:email', pkceEnabled: true, resourceUrl: 'https://api.github.com/user', }, },});
const result = await SocialLogin.login({ provider: 'oauth2', options: { providerId: 'github', },});
console.log(result.result.accessToken?.token);console.log(result.result.resourceData);Related docs
Section titled “Related docs”Keep going from GitHub
Section titled “Keep going from GitHub”If you are using GitHub to plan authentication and account flows, connect it with Using @capgo/capacitor-social-login for the native capability in Using @capgo/capacitor-social-login, @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login, @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and Two-factor authentication for the implementation detail in Two-factor authentication.