Upload source maps for Rollup
- 1
Install the PostHog Rollup plugin
RequiredTerminal - 2
Add PostHog plugin to your Rollup config
RequiredAdd the following to your
rollup.config.jsfile:rollup.config.jsWhere you should set the following environment variables:
Environment Variable Description POSTHOG_API_KEYPersonal API key with at least writeaccess onerror trackingPOSTHOG_ENV_IDProject ID you can find in your project settings POSTHOG_HOST(optional) Your PostHog instance URL. Defaults to https://us.i.posthog.comIf you are using a CI/CD service, make sure these environment variables are added to your project settings, not just your local setup. This enables source maps to be automatically uploaded on your production build.