Skip to content

SDK Package

Package: @hereby/sdk | TypeScript client SDK with Alpine integration

Client library for the Hereby API with HTTP batching, WebSocket subscriptions, token refresh handling, browser storage support, and an Alpine store plugin.

Core Exports

  • HerebyClient
  • createHerebyClient()
  • createAlpinePlugin()
  • service classes
  • async poller utilities
  • storage helpers
  • validator and error utilities

Client Behavior

HerebyClient currently supports:

  • HTTP tRPC via httpBatchLink
  • WebSocket tRPC via wsLink
  • split-link subscription routing
  • access-token injection
  • refresh-token retry on 401
  • browser token persistence
  • explicit destroy() cleanup

Services

The current client (packages/sdk/src/client/HerebyClient.ts) instantiates 53 service objects:

  • 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

Build Outputs

Configured outputs:

  • CommonJS build
  • ESM build
  • browser IIFE bundle

Browser global bundle name:

  • HerebySDK

Alpine Store

createAlpinePlugin() creates the shared $store.hereby store used by the frontend apps, including:

  • auth state
  • current user
  • loading state
  • login/logout helpers
  • permission checks
  • SDK instance access