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
HerebyClientcreateHerebyClient()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:
accountaiauthinvitesignuporganizationorganizationHolidayorganizationParameterteamemployeepayrollattendanceattendanceRateworkTimeClosingsalaryGradegradePromotionovertimeoffsiteWorkallowanceannualLeavePromotiondeductiondeductionImportresignationyearEndSettlementfixedIncentiveeducationSubsidyroleleaveRequestconversationmessagenotificationpermissionRequestnurseSchedulerdocumentteamDriveteamManagergeneralAffairsshiftshiftGroupmanagementDashboardmoduleRegistryitemCodefileStorage(StorageService)employeeCertificationcertificationTypeinventorysecomEventsheetViewsheetRowsheetCellsheetTemplatedocumentTemplateeSign
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