npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

oauth-btn

v1.0.33

Published

**OAuth 소셜 로그인 버튼 컴포넌트 모음집** 지원 플랫폼: GitHub / Google / Kakao / Naver Tailwind 기반 + 커스터마이징 가능한 React 컴포넌트

Readme

React OAuth Social Button

OAuth 소셜 로그인 버튼 컴포넌트 모음집
지원 플랫폼: GitHub / Google / Kakao / Naver
Tailwind 기반 + 커스터마이징 가능한 React 컴포넌트

VITE 기반으로 개발되었습니다.


설치

npm install oauth-btn

사용법

import { KakaoBtn, GoogleBtn, NaverBtn, GithubBtn } from 'oauth-btn';

<KakaoBtn shape="rect" />
<GoogleBtn shape="circle" />
<NaverBtn shape="square" />
<GithubBtn shape="rect" />

⚙️ Props 설명

| prop | 타입 | 기본값 | 설명 | |-------------|----------|----------------|----------------------------------------------------| | shape | string | 'rect' | 'rect', 'circle', 'square' 중 하나 선택 | | radius | string | — | Tailwind의 border-radius 클래스 (rounded-md) | | bgColor | string | 'transparent'| Tailwind 배경 색상 클래스 | | textColor | string | 'text-white' | Tailwind 텍스트 색상 클래스 | | fontSize | string | 'text-sm' | Tailwind 폰트 크기 클래스 | | onClick | func | — | 클릭 이벤트 핸들러 |


🔐 OAuth 연동 방식

버튼 클릭 → provider의 인증 페이지로 리디렉션 → code 발급 → 백엔드에서 토큰 교환

https://provider.com/oauth2/authorize?
  client_id=YOUR_CLIENT_ID&
  redirect_uri=YOUR_CALLBACK_URL&
  response_type=code&
  state=SOME_RANDOM_STRING
  • 버튼 컴포넌트는 위 URL로 이동하는 역할만 수행합니다.
  • state는 CSRF 공격 방지를 위해 자동 생성됩니다 (crypto.randomUUID()).

보안 및 주의사항

  • OAuth 앱 설정에서 redirect_uri 를 정확하게 등록하세요
  • state 파라미터를 백엔드에서 검증하여 CSRF 방지
  • client_id와 redirect_uri는 .env 파일에 보관
  • .env 파일은 반드시 .gitignore 처리
  • 이 라이브러리는 프론트엔드 UI 용도입니다 (access_token 처리는 백엔드에서!)

.env 설정 예시

.env.example:

VITE_KAKAO_CLIENT_ID=your_kakao_key
VITE_KAKAO_REDIRECT_URI=http://localhost:5173/auth/kakao/callback

VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_GOOGLE_REDIRECT_URI=http://localhost:5173/auth/google/callback

VITE_NAVER_CLIENT_ID=your_naver_id
VITE_NAVER_REDIRECT_URI=http://localhost:5173/auth/naver/callback

VITE_GITHUB_CLIENT_ID=your_github_id
VITE_GITHUB_REDIRECT_URI=http://localhost:5173/auth/github/callback

미리보기

(preview.png)


라이선스

MIT


기여

버그 제보, PR 환영합니다! 패키지 이름은 oauth-btn, 레포는 github-repo에서 확인

Made by JadenMeister

--- ENGLISH ---

React OAuth Social Button

A customizable collection of OAuth social login buttons
Supported platforms: GitHub / Google / Kakao / Naver
Built with Tailwind CSS + customizable React components

Developed using VITE


📦 Installation

npm install oauth-btn

or

yarn add oauth-btn

Usage

import { KakaoBtn, GoogleBtn, NaverBtn, GithubBtn } from 'oauth-btn';

<KakaoBtn shape="rect" />
<GoogleBtn shape="circle" />
<NaverBtn shape="square" />
<GithubBtn shape="rect" />

Props

| Prop | Type | Default | Description | |--------------|----------|------------------|-------------------------------------------------------------| | shape | string | 'rect' | One of 'rect', 'circle', or 'square' | | radius | string | — | Tailwind border radius class (e.g. rounded-md) | | bgColor | string | 'transparent' | Tailwind background color class | | textColor | string | 'text-white' | Tailwind text color class | | fontSize | string | 'text-sm' | Tailwind font size class | | onClick | func | — | Click event handler |


OAuth Flow

Clicking a button will redirect the user to the provider's auth page:

https://provider.com/oauth2/authorize?
  client_id=YOUR_CLIENT_ID&
  redirect_uri=YOUR_CALLBACK_URL&
  response_type=code&
  state=SOME_RANDOM_STRING
  • The button only redirects to the provider.
  • state is generated using crypto.randomUUID() to prevent CSRF attacks.

🔒 Security & Notes

  • Ensure that redirect_uri is properly registered in your OAuth app settings.
  • Verify the state parameter in your backend to prevent CSRF.
  • Keep your client_id and redirect_uri in a .env file.
  • Always add your .env to .gitignore.
  • This package is strictly for frontend UI use — token handling must be done on the backend.

📁 .env Example

.env.example:

VITE_KAKAO_CLIENT_ID=your_kakao_key
VITE_KAKAO_REDIRECT_URI=http://localhost:5173/auth/kakao/callback

VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_GOOGLE_REDIRECT_URI=http://localhost:5173/auth/google/callback

VITE_NAVER_CLIENT_ID=your_naver_id
VITE_NAVER_REDIRECT_URI=http://localhost:5173/auth/naver/callback

VITE_GITHUB_CLIENT_ID=your_github_id
VITE_GITHUB_REDIRECT_URI=http://localhost:5173/auth/github/callback

Preview

preview.png


License

MIT


Contributing

Bug reports and pull requests are welcome! The package name is oauth-btn, and the repository can be found here: github-repo

Made by JadenMeister