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

hanwha-2fa-agent

v1.0.1

Published

한화 TOTP 팝업 호출 에이전트 라이브러리

Downloads

3

Readme

hanwha-2fa-agent

한화 2fa 팝업 호출 에이전트 라이브러리

설치

npm install hanwha-2fa-agent

사용 방법

UMD (브라우저)

<script src="./dist/index.umd.js"></script>
<script>
  Hanwha2faAgent.open2faPopup({
    userId: '[email protected]',
    apiKey: 'your-api-key',
    onSuccess: function(data) {
      console.log('인증 성공:', data);
    },
    onError: function(error) {
      console.error('인증 실패:', error);
    },
    onCancel: function() {
      console.log('취소됨');
    }
  });
</script>

ES Module

import { open2faPopup } from 'hanwha-2fa-agent';

open2faPopup({
  userId: '[email protected]',
  apiKey: 'your-api-key',
  onSuccess: (data) => {
    console.log('인증 성공:', data);
  },
  onError: (error) => {
    console.error('인증 실패:', error);
  },
  onCancel: () => {
    console.log('취소됨');
  }
});

⚠️ Vue 빌드 실패 시

Vue 프로젝트에서 빌드시 아래와 같은 에러가 발생할 경우:

Module not found: Error: Can't resolve 'hanwha-2fa-agent'

vue.config.js 파일에서 config.resolve.alias에 다음 코드를 추가해주세요.

// vue.config.js 예시
module.exports = {
  chainWebpack: config => {
    config.resolve.alias
      .set('hanwha-2fa-agent', require.resolve('hanwha-2fa-agent/dist/index.esm.js'));
  }
};

이 설정을 통해 ESM 빌드가 제대로 인식되어 빌드 오류가 해결됩니다.


CommonJS

const { open2faPopup } = require('hanwha-2fa-agent');

await open2faPopup({
  userId: '[email protected]',
  apiKey: 'your-api-key',
  onSuccess: (data) => {
    console.log('인증 성공:', data);
  },
  onError: (error) => {
    console.error('인증 실패:', error);
  },
  onCancel: () => {
    console.log('취소됨');
  }
});

API

open2faPopup(options)

TOTP 팝업을 열고 인증을 처리합니다.

옵션

| 옵션 | 타입 | 필수 | 기본값 | 설명 | |------|------|------|--------|------| | userId | string | ✅ | - | 사용자 ID | | apiKey | string | ✅ | - | API 키 | | popupUrl | string | ❌ | "https://dashboard.cleverse.kr/totp-app/popup" | 팝업 URL | | width | number | ❌ | 800 | 팝업 너비 (px) | | height | number | ❌ | 800 | 팝업 높이 (px) | | onSuccess | (data: PopupMessage) => void | ❌ | - | 인증 성공 콜백 (type: "success") | | onError | (data: PopupMessage) => void | ❌ | - | 에러 발생 콜백 (type: "error") | | onCancel | (data: PopupMessage) => void | ❌ | - | 취소 콜백 (type: "cancel") |

반환값

  • Promise<Window | null>: 열린 팝업 윈도우 객체 또는 null (팝업이 차단된 경우)

PopupMessage 인터페이스

interface PopupMessage {
  type: "success" | "error" | "cancel";
  process: "register" | "login" | "reset";
  data?: any;
  error?: string;
}

콜백별 메시지 유형

onSuccess 콜백

인증 성공 시 호출되며, type: "success"PopupMessage를 받습니다.

onSuccess: (message: PopupMessage) => {
  // message.type === "success"
  // message.process === "register" | "login" | "reset"
  // message.data: 성공 데이터
  console.log('인증 성공:', message.data);
}

예시:

{
  type: "success",
  process: "login",
  data: {
    // 인증 성공 데이터
  }
}
onError 콜백

에러 발생 시 호출되며, type: "error"PopupMessage를 받습니다.

onError: (message: PopupMessage) => {
  // message.type === "error"
  // message.process === "register" | "login" | "reset"
  // message.error: 에러 메시지
  console.error('에러 발생:', message.error);
}

예시:

{
  type: "error",
  process: "login",
  error: "인증 실패"
}
onCancel 콜백

사용자가 취소했을 때 호출되며, type: "cancel"PopupMessage를 받습니다.

onCancel: (message: PopupMessage) => {
  // message.type === "cancel"
  // message.process === "register" | "login" | "reset"
  console.log('사용자가 취소했습니다.');
}

예시:

{
  type: "cancel",
  process: "register"
}

예제

자세한 사용 예제는 example.html 파일을 참고하세요.

개발

빌드

npm run build

개발 모드 (watch)

npm run dev

라이선스

ISC