콘텐츠로 건너뛰기

GitHub

이 콘텐츠는 아직 귀하의 언어로 제공되지 않습니다.

GitHub is supported through the built-in generic oauth2 provider.

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);