Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Question: Feature Flags in Server-Side Next.js #39

@Tbhesswebber

Description

@Tbhesswebber

Context

Next.js (and many other frameworks) provide methods for server-side rendering/hydrating of React components. In Next, this is achieved by exporting a function called getServerSideProps from the same file as your page component. getServerSideProps can have access to the logged-in user and allows redirects, including out-of-the-box support for 404 pages.

For pages that aren't yet available to the public, I'd like to use a feature flag and the user identity to return the correct props or redirect.

The Problem

It seems that the current posthog-node implementation requires a personal API key with full account access rather than an organizational API key with scoped account access. This seems to imply that API keys are intended to exist for dev/analytics tools for team members and not for production application use.

The Question

Does instantiating posthog-node on the server with a personal API key provide any additional access to the API through the posthog instance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions