GitHub
Konten ini belum tersedia dalam bahasa Anda.
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);