API Reference
The API reference is generated from the TypeScript source. For v4 application setup, start with the root web entry point and reach for /headless only when you do not want DOM UI.
Entry Points
react-achievements- default web API with provider, hooks, built-in notifications, confetti, widget, modal, and list componentsreact-achievements/web- explicit alias for the web APIreact-achievements/headless- provider, hooks, engine, storage, and types without DOM UI components
Main v4 Exports
AchievementProviderAchievementsWidget,AchievementsModal,AchievementsListuseSimpleAchievements,useAchievementState,useAchievements,useAchievementEngineAchievementEngineand event typesStorageType, storage classes,AsyncStorageAdapter, andOfflineQueueStorage- Import/export helpers and achievement builder utilities
- Error classes and guards such as
AchievementError,StorageError,isAchievementError, andisRecoverableError
Common UI Props
AchievementsWidget.density- use"compact"for square achievement badges or omit it for the default comfortable layoutAchievementsWidget.modalBackdropBlur- set modal backdrop blur with a number of pixels or a CSS length stringAchievementsWidget.hideModalScrollbar- hide visible modal scrollbar chrome while preserving scrollAchievementsModal.density,AchievementsModal.backdropBlur, andAchievementsModal.hideScrollbar- the same controls when opening the modal yourselfAchievementsList.density- render inline achievement content as the same compact square badge gridAchievementProvider.ui.notificationDuration- set built-in unlock notification auto-dismiss timing in milliseconds
Browse API Documentation
Use the sidebar to explore generated pages by category:
- Classes -
AchievementBuilder, storage implementations, and error classes - Interfaces - configuration, provider, widget, modal, storage, and event types
- Functions - hooks and data utilities
- Type aliases and enumerations - utility types and
StorageType
Quick Links
- Full Documentation - Getting started and guides
- GitHub Repository - Source code
- Examples - Redux, Zustand, Context implementations
- Contributing
- License