Skip to content
프로젝트

소개

새로운 Google Identity Services SDK를 사용하는 React용 Google OAuth2 🚀

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+3
in 15 days
+2
in 1 month
+2

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

React OAuth

Modern OAuth2 authentication libraries for React 🚀

npm version npm version License: MIT

Demo • Documentation • GitHub


Overview

React OAuth is a collection of production-ready OAuth2 libraries for React applications. Each package is designed to be simple, type-safe, and easy to integrate into your projects.

Packages

Package Description NPM
@react-oauth/google Google OAuth2 using the new Google Identity Services SDK npm
@react-oauth/github Modern React hook for GitHub OAuth authentication npm

Quick Start

Google OAuth

npm install @react-oauth/google
# or
yarn add @react-oauth/google

Basic Usage:

import { GoogleOAuthProvider, GoogleLogin } from '@react-oauth/google';

function App() {
  return (
    <GoogleOAuthProvider clientId="<your_client_id>">
      <GoogleLogin
        onSuccess={credentialResponse => {
          console.log(credentialResponse);
        }}
        onError={() => {
          console.log('Login Failed');
        }}
      />
    </GoogleOAuthProvider>
  );
}

Features:

  • ✅ Sign In With Google button
  • ✅ One-tap sign-up
  • ✅ Automatic sign-in
  • ✅ Custom login buttons
  • ✅ Implicit & Authorization Code flows
  • ✅ Full TypeScript support

📖 View Full Google Documentation →


GitHub OAuth

npm install @react-oauth/github
# or
yarn add @react-oauth/github

Basic Usage:

import { useGitHubLogin } from '@react-oauth/github';

function LoginButton() {
  const { initiateGitHubLogin, isLoading } = useGitHubLogin({
    clientId: 'your-github-client-id',
    redirectUri: 'http://localhost:3000/callback',
    onSuccess: response => {
      console.log('Authorization code:', response.code);
      // Exchange code for access token on your backend
    },
    onError: error => {
      console.error('Authentication failed:', error);
    },
  });

  return (
    <button onClick={initiateGitHubLogin} disabled={isLoading}>
      {isLoading ? 'Loading...' : 'Sign in with GitHub'}
    </button>
  );
}

Features:

  • ✅ Production-ready React hook
  • ✅ Fully typed with TypeScript
  • ✅ Zero runtime dependencies
  • ✅ Flexible API with complete UI control
  • ✅ Comprehensive error handling
  • ✅ Built-in CSRF protection

📖 View Full GitHub Documentation →


Documentation

Google OAuth

GitHub OAuth


Demo

Check out the live demo to see the Google OAuth package in action:

🔗 https://react-oauth.vercel.app/ (Google OAuth only)


Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.


License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ for the React community

GitHub • Issues • @react-oauth/google • @react-oauth/github

관련 프로젝트 살펴보기

불러오는 중…