v0.0.13: Remove useConfig dependency from client hooks

Makes client hooks work outside of Payload Admin UI context by:
- Adding FeatureFlagOptions parameter to all hooks for configuration
- Using window.location.origin as default serverURL when in browser
- Removing @payloadcms/ui dependency from client hooks
- Allowing custom serverURL, apiPath, and collectionSlug configuration

This fixes the webpack error "_payloadcms_ui__WEBPACK_IMPORTED_MODULE_1__.b() is undefined"
when using the hooks in frontend applications.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-03 18:25:32 +02:00
parent e26d895864
commit 4f802c8cc9
3 changed files with 45 additions and 18 deletions

View File

@@ -7,4 +7,5 @@ export {
useRolloutCheck,
withFeatureFlag,
type FeatureFlag,
type FeatureFlagOptions,
} from '../hooks/client.js'