implementing-api-surveys
Skill by PostHog
Implements a PostHog API (headless) survey in your own codebase, so your UI renders it and sends the events PostHog expects. It then checks that the first response arrived. Built for developers who want custom survey UIs.
Install implementing-api-surveys
Built from the published package, never by AI.
git clone --depth 1 https://github.com/PostHog/posthog /tmp/posthog && mkdir -p ~/.claude/skills && cp -r /tmp/posthog/products/surveys/skills/implementing-api-surveys ~/.claude/skills/implementing-api-surveysRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install implementing-api-surveys in Claude Code
git clone --depth 1 https://github.com/PostHog/posthog /tmp/posthog && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/posthog/products/surveys/skills/implementing-api-surveys ~/.gemini/antigravity-cli/skills/implementing-api-surveysAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install implementing-api-surveys in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill helps an AI assistant implement a PostHog API (headless) survey inside the user's own codebase. PostHog stores the survey definition but does not render it, so the application renders the questions with its own UI components and captures the survey events PostHog expects. It covers the posthog-js event contract, server-side SDK capture, and verification of the first response through MCP.
The skill reads the existing framework, component library and PostHog setup, then wires a trigger that calls getActiveMatchingSurveys. It captures survey shown, survey sent and survey dismissed events, using a shared submission id so each submission counts as one response. After a test submission, it checks the responses list and survey stats. It is aimed at developers who want a survey rendered in their own app.
Written from the project's SKILL.md and checked against it.
What it can do
- posthog:survey-getFetches the survey by id to read its questions, types, choices and iteration.
- posthog:surveys-responses-listLists survey responses to confirm answers appear under the right question.
- posthog:survey-statsChecks shown and sent counts to confirm one submission is one response.
- Browser trigger setupWires posthog-js to show the survey once flags and surveys have loaded.
- Survey event captureCaptures survey shown, survey sent and survey dismissed events with the expected properties.
- Server and mobile guidancePoints server-rendered pages, other SDKs and custom mobile UIs to a separate reference.
What you need
- A PostHog project with an api type survey
- posthog-js 1.249.2 or newer for browser apps
- PostHog MCP access for the posthog: tools
Try asking
- Implement my PostHog API survey abc123 in this React app
- Build a custom survey UI that renders my headless survey
- Verify the first response to my API survey and check its stats
Good to know
- PostHog does not render api surveys, so the application must render them.
- Older posthog-js versions do not set person properties and seen state on capture.
- Mobile SDKs render only popover surveys natively, so custom mobile UIs follow the server pattern.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: products/surveys/skills/implementing-api-surveys/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
references/event-contract.md3 KB -
references/server-and-mobile.md4 KB
Alternatives to implementing-api-surveys
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
implementing-api-surveys: common questions
Does PostHog render API surveys automatically?
No. The source says an api survey is only a definition in PostHog, and the application renders the questions and captures the survey events.
Which posthog-js version does this need?
Version 1.249.2 or newer. The source says older versions do not set the person properties and seen state on capture.
Do I need to set the survey seen state myself?
No. The source says posthog-js sets the responded or dismissed state when it captures survey sent or survey dismissed, so adding it yourself duplicates it.
How do I install implementing-api-surveys?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is implementing-api-surveys free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is implementing-api-surveys safe to use?
It scores 86 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to implementing-api-surveys?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
