@sudobility/whisperly_lib
v1.0.63
Published
Frontend business logic library for Whisperly with Zustand stores and manager hooks
Maintainers
Readme
@sudobility/whisperly_lib
Frontend business logic library for Whisperly with Zustand stores and manager hooks.
Installation
bun add @sudobility/whisperly_libUsage
import { useProjectManager, useTranslationManager } from "@sudobility/whisperly_lib";
const { projects, isLoading, createProject } = useProjectManager({
baseUrl,
getIdToken,
entitySlug,
});
const { translate, isTranslating } = useTranslationManager({ baseUrl });
const result = await translate({
orgPath: "my-org",
projectName: "my-project",
request: { strings: ["Hello"], target_languages: ["es"] },
});API
Manager Hooks
useProjectManager-- Project CRUD with auto-fetchuseProjectDetail-- Single project detailuseDictionaryManager-- Dictionary CRUD (entity+project scoped)useAnalyticsManager-- Analytics with date filtersuseSettingsManager-- User settingsuseLanguagesManager-- Project + available languagesuseTranslationManager-- Translation mutation (public, no auth)
Zustand Stores
projectStore, dictionaryStore, settingsStore, analyticsStore -- with selectors and resetAllStores() for logout cleanup.
Auth Hook
useFirebaseAuth() -- Firebase auth state listener returning { user, loading, getIdToken }.
Development
bun run build # Build ESM
bun run test:run # Run tests once
bun run typecheck # TypeScript checkRelated Packages
whisperly_types-- Shared type definitionswhisperly_client-- API client SDKwhisperly_api-- Backend API serverwhisperly_app-- Web application consumer
License
BUSL-1.1
