feat: Better document CSP Tracking (#13328)

This commit is contained in:
Rafael Audibert
2025-10-21 17:52:32 -03:00
committed by GitHub
parent cbde5dc0aa
commit ac48840f65
3 changed files with 16 additions and 2 deletions

View File

@@ -100,6 +100,13 @@ Our client SDKs (where appropriate) will take care of selecting the correct doma
| `us.posthog.com` | US PostHog app domain (used by the Toolbar) |
| `app.posthog.com` | Legacy ingestion endpoint |
## Keeping track of your CSP violations
You can [send reports of CSP rule violations](/docs/csp-tracking) to PostHog, which is useful for
* warning when your website is under certain kinds of attack
* debugging problems when adding external scripts/media/etc to your site
* being confident that changes to your site haven't broken the loading of any resources
## Troubleshooting / FAQ

View File

@@ -1,5 +1,5 @@
---
title: CSP Tracking
title: CSP Tracking (Beta)
sidebar: Docs
showTitle: true
---
@@ -12,6 +12,8 @@ You can send reports of CSP rule violations to PostHog, which is useful for
* debugging problems when adding external scripts/media/etc to your site
* being confident that changes to your site haven't broken the loading of any resources
> **Note:** CSP Tracking is currently in beta. Give feedback by [raising an issue](https://github.com/PostHog/posthog/issues/new?labels=feature%2Fcsp-tracking).
## Where do I start?
### Create a new dashboard using the CSP template

View File

@@ -96,6 +96,11 @@ const FEATURE_DATA: Record<string, BaseFeature> = {
owner: ['platform-features'],
label: 'feature/comments',
},
'csp-tracking': {
feature: 'CSP tracking',
owner: ['web-analytics'],
label: 'feature/csp-tracking',
},
'currency-rate-dataset': {
feature: 'Currency rate dataset',
owner: ['revenue-analytics'],
@@ -425,7 +430,7 @@ const FEATURE_DATA: Record<string, BaseFeature> = {
},
}
export const useFeatureOwnership = ({ teamSlug }: { teamSlug?: string } = {}) => {
export const useFeatureOwnership = ({ teamSlug }: { teamSlug?: string } = {}): { features: Feature[] } => {
const features = Object.entries(FEATURE_DATA).reduce((acc, [key, feature]) => {
const featureWithSlug: Feature = {
...feature,