Spaces:
Configuration error
Configuration error
Download frontend/src/utils/handle-capture-consent.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/handle-capture-consent.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/utils/handle-capture-consent.ts
-
curl -L -o handle-capture-consent.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/handle-capture-consent.ts
382 Bytes
| import posthog from "posthog-js"; | |
| /** | |
| * Handle user consent for tracking | |
| * @param consent Whether the user consents to tracking | |
| */ | |
| export const handleCaptureConsent = (consent: boolean) => { | |
| if (consent && !posthog.has_opted_in_capturing()) { | |
| posthog.opt_in_capturing(); | |
| } | |
| if (!consent && !posthog.has_opted_out_capturing()) { | |
| posthog.opt_out_capturing(); | |
| } | |
| }; | |