Socket
Book a DemoInstallSign in
Socket

@posthog/nextjs

Package Overview
Dependencies
Maintainers
14
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

@posthog/nextjs

NextJS SDK for Posthog 🦔

unpublished
Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
208
18.86%
Maintainers
14
Weekly downloads
 
Created
Source

PostHog Next.js

Please see the main PostHog docs.

Usage

// next.config.ts
import { withPostHogConfig } from "@posthog/nextjs";

const nextConfig = {
  // Your Next.js configuration here
};

export default withPostHogConfig(nextConfig, {
  authToken: process.env.POSTHOG_AUTH_TOKEN!, // Private API key used for sourcemap uploads, see https://app.posthog.com/settings/user-api-keys
  envId: process.env.POSTHOG_ENV_ID!, // Environment ID, see https://app.posthog.com/settings/environment#variables
  host: process.env.NEXT_PUBLIC_POSTHOG_HOST!, // (optional) Host URL, defaults to https://us.posthog.com
  sourcemaps: { // (optional)
    enabled: true, // (optional) Enable sourcemaps generation and upload, default to true on production builds
    project: "my-application", // (optional) Project name, defaults to repository name
    version: "1.0.0", // (optional) Release version, defaults to current git commit
    deleteAfterUpload: true, // (optional) Delete sourcemaps after upload, defaults to true
  },
});

Questions?

Check out our community page.

Keywords

posthog

FAQs

Package last updated on 24 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts