Overview
TheuseLicenseStatus hook provides a convenient way to manage and monitor VoiceTypr’s license and trial status in React components. It wraps the License Context and provides derived state for common license checks.
Import
Usage
Return Values
The hook returns an object with the following properties:LicenseStatus | null
Current license status object, or
null if not yet loadedboolean
Computed boolean indicating if user has valid access (trial or licensed)
boolean
True while license status is being checked from the backend
() => Promise<void>
Function to manually trigger a license status check
LicenseStatus Type
The
status field uses 'active' in the frontend (mapped from 'licensed' in backend) for consistency with UI state naming.Examples
Display Trial Countdown
Conditional Feature Access
Manual License Check
License Activation Flow
Show Expiration Warning
Account Tab Integration
Implementation Details
TheuseLicenseStatus hook is a thin wrapper around the LicenseContext that:
- Accesses license state from React Context
- Computes derived values like
isValid - Provides a cleaner API for component use
Context Provider
The hook requires theLicenseProvider to be present in the component tree:
Automatic Status Checks
The License Context automatically:- Checks license status on app startup
- Respects 8-hour cache TTL
- Validates against offline grace periods
- Updates status when license commands are invoked
See Also
- License Commands - Backend license management commands
- Settings Commands - General settings management