installing-posthog-in-a-codebase
यह क्या करती है
यह स्किल एजेंट को उस कोडबेस में PostHog की एनालिटिक्स लाइब्रेरी इंस्टॉल कराती है जिसे वह पढ़ और बदल सकता है। यह उन डेवलपर के लिए है जो अपने ऐप में प्रोडक्ट एनालिटिक्स और सेशन रिप्ले जोड़ना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप अपने ऐप में PostHog, प्रोडक्ट एनालिटिक्स या सेशन रिप्ले जोड़ने को कहें।
- ✓जब आप चाहें कि आपके फ़्रेमवर्क, जैसे React या Next.js, के लिए PostHog लाइब्रेरी इंस्टॉल हो।
- ✓जब आप चाहें कि एजेंट आपके प्रोजेक्ट टोकन और होस्ट सेटिंग सही जगह पर रखे।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/wizard/skills/installing-posthog-in-a-codebase/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“कृपया मेरे Next.js ऐप में PostHog एनालिटिक्स जोड़िए, उनके डॉक्स के मौजूदा सेटअप के अनुसार।”
हर हफ़्ते 5 नई skills, 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
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।