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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ce1pers/social-login-redirect

v1.1.1

Published

Social login redirect helper.

Readme

@ce1pers/social-login-redirect

브라우저에서 social login provider의 OAuth authorization URL을 만들거나 해당 URL로 이동시키는 TypeScript helper입니다. token 교환, callback 검증, 사용자 session 처리는 제공하지 않습니다.

설치

npm install @ce1pers/social-login-redirect

공개 API

make*LoginUrl은 URL 문자열을 반환하고, *Login은 window.location.href를 변경해 브라우저를 이동시킨 뒤 별도 값을 반환하지 않습니다.

| API | 입력 필드 | | --- | --- | | makeGoogleLoginUrl, googleLogin | 필수 client_id, redirect_uri, scope; 선택 response_type, access_type, state, include_granted_scopes, enable_granular_consent, login_hint, prompt | | makeKakaoLoginUrl, kakaoLogin | 필수 client_id, redirect_uri; 선택 response_type, scope, prompt, login_hint, service_terms, state, nonce | | makeNaverLoginUrl, naverLogin | 라이브러리 입력 필수 clientId, redirectUri, state; 선택 response_type | | appleLogin | client_id, redirect_uri, nonce, response_mode, scope, state; 선택 response_type | | facebookLogin | client_id, redirect_uri, state; 선택 version, response_type, scope | | makeLineLoginUrl, lineLogin | client_id, redirect_uri, state, scope; response_type는 code 기본값, version, nonce, prompt, max_age, ui_locales, bot_prompt, initial_amr_display, switch_amr, disable_auto_login, disable_ios_auto_login, code_challenge, code_challenge_method, response_mode 선택 |

Provider마다 필드명이 다릅니다. Kakao·Google은 라이브러리 입력과 URL에서 client_id/redirect_uri를 사용하고, Naver는 라이브러리 입력으로 clientId/redirectUri를 받은 뒤 URL에서는 client_id/redirect_uri로 변환합니다.

사용 예제

import {
  googleLogin,
  makeKakaoLoginUrl,
  makeLineLoginUrl,
  makeNaverLoginUrl,
} from "@ce1pers/social-login-redirect";

const kakaoUrl = makeKakaoLoginUrl({
  client_id: "YOUR_KAKAO_REST_API_KEY",
  redirect_uri: "https://example.com/auth/kakao/callback",
  state: "random-state-value",
});

const naverUrl = makeNaverLoginUrl({
  clientId: "YOUR_NAVER_CLIENT_ID",
  redirectUri: "https://example.com/auth/naver/callback",
  state: "random-state-value",
});

const lineUrl = makeLineLoginUrl({
  client_id: "YOUR_LINE_CHANNEL_ID",
  redirect_uri: "https://example.com/auth/line/callback",
  state: "random-state-value",
  scope: "profile openid email",
});

// URL을 직접 이동시키는 함수는 반환값이 없습니다.
googleLogin({
  client_id: "YOUR_GOOGLE_CLIENT_ID",
  redirect_uri: "https://example.com/auth/google/callback",
  scope: "openid email profile",
  state: "random-state-value",
});

redirect_uri는 각 provider console에 등록한 원본 callback URL을 전달하며, helper가 query string에 맞게 인코딩합니다. state는 로그인 시도마다 예측할 수 없는 값으로 만들고 callback에서 원래 값과 비교해야 합니다. 이 라이브러리는 state·PKCE 검증이나 token 교환을 대신하지 않습니다.

검증

npm run lint
npm run build
npm test

관련 문서