Files
mxivideo/jm_video_ui.md
root a5381e5305 feat: implement Cloudflare KV utility class and React hooks
- Add CloudflareKVClient class with full CRUD operations
- Support for batch operations, metadata, and key listing
- Implement useCloudflareKV hook for React components
- Add useKVValue hook for auto-loading specific keys
- Include comprehensive error handling and loading states
- Create demo component showing all functionality
- Add detailed documentation and usage examples
- Support for JSON parsing and custom configurations
- Based on jm_video_ui.md specifications
2025-07-10 20:51:09 +08:00

17 lines
737 B
Markdown

config:
cloudflare_api_key: str = "dlGquMNiAX-S7SV9pXne7YGfdH_fEgq3TfIGgNcQ"
cloudflare_url: str = "https://api.cloudflare.com/client/v4/"
cloudflare_account_id: str = "67720b647ff2b55cf37ba3ef9e677083"
cloudflare_kv_id: str = "995d7eff088547d7a7d8fea53e56115b"
Authorization: `Bearer ${config.cloudflare_api_key}`
kv api:
- put
curl put ${config.cloudflare_url}$/accounts/${config.cloudflare_account_id}/storage/kv/namespaces/${config.cloudflare_kv_id}/values/$KEY_NAME \
-X PUT \
-H 'Content-Type: multipart/form-data' \
-d '{
"value": "Some Value"
}'
curl get ${config.cloudflare_url}$/accounts/${config.cloudflare_account_id}/storage/kv/namespaces/${config.cloudflare_kv_id}/values/$KEY_NAME