Skip to content

SDK 패키지

패키지: @hereby/sdk | Alpine 통합 TypeScript 클라이언트 SDK

HTTP 배치 호출, WebSocket 구독, 토큰 갱신, 브라우저 저장소, Alpine 스토어 플러그인을 포함한 Hereby API 클라이언트 라이브러리입니다.

핵심 export

  • HerebyClient
  • createHerebyClient()
  • createAlpinePlugin()
  • 각 서비스 클래스
  • async poller 유틸
  • storage 헬퍼
  • validator와 error 유틸

클라이언트 동작

HerebyClient는 현재 다음을 지원합니다.

  • httpBatchLink 기반 HTTP tRPC
  • wsLink 기반 WebSocket tRPC
  • 구독 분기 처리
  • access token 헤더 주입
  • 401 시 refresh token 재시도
  • 브라우저 토큰 저장
  • destroy() 정리

서비스

현재 클라이언트(packages/sdk/src/client/HerebyClient.ts)는 53개의 서비스 객체를 생성합니다.

  • account
  • ai
  • auth
  • invite
  • signup
  • organization
  • organizationHoliday
  • organizationParameter
  • team
  • employee
  • payroll
  • attendance
  • attendanceRate
  • workTimeClosing
  • salaryGrade
  • gradePromotion
  • overtime
  • offsiteWork
  • allowance
  • annualLeavePromotion
  • deduction
  • deductionImport
  • resignation
  • yearEndSettlement
  • fixedIncentive
  • educationSubsidy
  • role
  • leaveRequest
  • conversation
  • message
  • notification
  • permissionRequest
  • nurseScheduler
  • document
  • teamDrive
  • teamManager
  • generalAffairs
  • shift
  • shiftGroup
  • managementDashboard
  • moduleRegistry
  • itemCode
  • fileStorage (StorageService)
  • employeeCertification
  • certificationType
  • inventory
  • secomEvent
  • sheetView
  • sheetRow
  • sheetCell
  • sheetTemplate
  • documentTemplate
  • eSign

빌드 출력

구성된 출력:

  • CommonJS
  • ESM
  • 브라우저 IIFE

브라우저 글로벌 이름:

  • HerebySDK

Alpine 스토어

createAlpinePlugin()은 프론트엔드 앱이 공통으로 사용하는 $store.hereby를 생성합니다.

  • 인증 상태
  • 현재 사용자
  • 로딩 상태
  • 로그인/로그아웃
  • 권한 확인
  • SDK 인스턴스