installing-posthog-in-a-codebase
하는 일
이 스킬은 에이전트가 읽고 수정할 수 있는 코드베이스에 PostHog 분석 라이브러리를 설치하게 합니다. 앱에 제품 분석과 세션 리플레이를 추가하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓앱에 PostHog, 제품 분석 또는 세션 리플레이를 추가해 달라고 요청할 때.
- ✓React나 Next.js처럼 내 프레임워크에 맞게 PostHog 라이브러리를 설치하고 싶을 때.
- ✓에이전트가 프로젝트 토큰과 호스트 설정을 올바른 곳에 두기를 원할 때.
스킬 링크
https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-in-a-codebase/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Next.js 앱에 PostHog 분석을 추가해 주세요. 문서에 있는 현재 설정 방법을 따라 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 프로젝트 파일에서 프레임워크를 감지하고, 해당 PostHog 문서 페이지를 읽습니다. 그다음 최신 패키지를 설치하고, 프로젝트 토큰과 호스트 설정을 추가하며, 설정 코드를 작성합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Installing PostHog in a codebase
Use this skill when you can read and edit the user's code.
If you can't access their code, as is common in ChatGPT on the web or Claude on the web, use installing-posthog-from-chat.
PostHog's docs are the source of truth for each SDK's setup. Init options, file locations and recommended settings change between SDK releases, so read the docs page for the framework before you write code, and follow it rather than what you remember.
1. Find the framework and read its docs
Detect the framework from the manifest files (package.json, pyproject.toml, requirements.txt, Gemfile, composer.json, go.mod, and so on) and the app's entry points.
A web app with its own backend usually needs a client SDK and a server SDK, so read both pages.
For a framework that isn't listed, call docs-search with the framework name.
2. Install the latest SDK
Add each package with the project's own package manager and no version, for example npm install posthog-js, pnpm add posthog-node, uv add posthog or bundle add posthog-ruby.
That resolves the newest release.
Don't type a version into the manifest from memory, because that pins an old release.
In a monorepo, install into the package that runs the app, not the workspace root.
3. Get the token and host
Call project-get without an ID.
Use api_token as the project token and api_host as the SDK's host option.
- Read both from environment variables in code, using the names the docs page uses (for example
NEXT_PUBLIC_POSTHOG_PROJECT_TOKENandNEXT_PUBLIC_POSTHOG_HOST). - Write the real values to the env file the framework loads, such as
.env.localor.env. If the project has an example env file, add the variable names there with empty values. - Never hard-code the
자주 묻는 질문
에이전트가 PostHog 설정을 기억에 의존하나요?
아니요. 설정 세부 사항은 릴리스마다 바뀌므로, 먼저 사용자의 프레임워크에 대한 현재 문서를 읽습니다.
코드에 접근하게 할 수 없다면 어떻게 하나요?
그 경우에는 다른 스킬을 쓰며, 그 스킬은 채팅에서 설정을 안내하고 풀 리퀘스트로 전달합니다.
어떤 프레임워크가 지원되나요?
React, Next.js, Vue, Nuxt 같은 일반 웹 프레임워크와 여러 서버 언어를 지원하며, 각각 별도의 문서 페이지가 있습니다.
상세 정보
작성자의 원본 설명
Install and configure a PostHog SDK in a repository you can read and edit, following PostHog's docs for the framework. Use when a user working in their codebase asks to add, install, or set up PostHog, product analytics, session replay, or a PostHog SDK. Covers finding the right docs page, installing the latest package, getting the project token and ingestion host from project-get, keeping them in the env file, server-side setup, identifying users, and verifying the change. If you can't access the user's code, as is common in ChatGPT on the web or Claude on the web, use installing-posthog-from
repo: PostHog/posthog
인기도
- GitHub 스타
- 41k
- 순위
- #6979
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
editing-agents-md
41k에이전트가 규칙을 AGENTS.md나 CLAUDE.md 중 어디에 둘지 정하고, 파일을 키우지 않으면서 잘 지켜지도록 쓰게 돕습니다.