The Userflow Installation Skill installs Userflow.js into your project through your AI coding agent. The agent reads your codebase, works out where initialization and identification belong for your framework, writes the code, and checks the result, so you don't have to translate installation docs into your own architecture.
The skill lives in the Userflow AI Skills Library on GitHub.
Before you start
You'll need:
A Userflow account with access to Settings → Environments or Settings → Installation
An AI coding agent with access to your project files — Claude Code, Cursor, GitHub Copilot, Codex, Windsurf, and others all work
A development or staging environment to test in, so you're not validating against live users
Step 1: Get your environment token
Userflow issues a separate token for each environment. Take the token for the environment this build targets — a Production token in a Staging build will mix content and users across both.
Option A — Settings → Environments
Open Settings in Userflow, then select Environments.
Copy the Userflow.js Token for the environment you're installing into.
Option B — Settings → Installation
Open Settings → Installation and select your environment.
The install snippet appears with your token already filled in, on both the NPM and HTML tabs.
If someone else is doing the install, use Copy all instructions (to send to a developer) to hand over the snippet with the token included.
Keep the token nearby — your agent will ask for it.
Step 2: Add the skill to your agent
Pick the route that matches your setup. All four give you the same skill.
Claude Code
/plugin marketplace add userflow/ai-skills-library
/plugin install userflow@ai-skills-libraryThen run /userflow:install-with-ai, or simply describe what you want and Claude will invoke the skill on its own.
skills.sh (Cursor, Codex, and other agents)
npx skills add userflow/ai-skills-library@install-with-aiAdd -g for a global install, or -a <agent> to target a specific agent.
Direct link (no installation)
Point your agent at the raw file and paste this into the chat:
Install Userflow.js in this project.
Use the Userflow installation skill:
https://raw.githubusercontent.com/userflow/ai-skills-library/refs/heads/main/skills/install-with-ai/SKILL.mdDownload
Step 3: Run the skill
Open your coding agent with access to your project and ask it to install Userflow.
The skill reads your codebase before it asks you anything, then confirms what it found — your framework, where users sign in and out, and which field to use as the user ID. Once you confirm, it writes the installation.
Expect it to ask for your environment token, and to check whether you want any user or company attributes included from the start.
What the skill does
Reads your codebase first, so you're not answering questions your code already answers — framework, bundler, auth flow, and user model.
Places the code correctly for your framework, including the client-side-only handling that Next.js App Router, Pages Router, Nuxt, and other server-rendered setups require.
Identifies only signed-in users. Identification stays on the authenticated path and never runs on public or marketing pages, which is what protects your Monthly Active User count.
Guards against duplicate identification with
isIdentified(), and handles account switching correctly.Wires
reset()on sign-out, including the server-redirect logout pattern used by JSP, PHP, Rails, and Django apps.Checks your Content Security Policy if you have one, so Userflow.js isn't silently blocked.
Leaves a note in
AGENTS.mdrecording how Userflow is installed, so future agent sessions extend the setup instead of installing it a second time.
The default installation is deliberately minimal: initialize, identify after sign-in, reset on sign-out. Advanced functions are added only if you ask for them.
If you don't have codebase access
Tell the skill you're scoping the work for a developer. Instead of writing code, it produces a USERFLOW_INSTALL_SPEC.md file containing the install method, token strategy, the exact code with your user ID field named, where each call belongs, and a verification checklist.
The spec is self-contained, so your developer can implement it without seeing your conversation.
Step 4: Verify the installation
Deploy to the environment whose token you used.
Sign in as a real or test user.
Open Userflow and confirm the user appears with the attributes you sent. The installation check in Settings → Installation confirms the script is detected.
Load a public page while signed out and run
userflow.isIdentified()in your browser console. It should returnfalse.
That last check matters most. It confirms anonymous visitors aren't being identified, which is the difference between a correct install and an unexpected MAU bill.
Troubleshooting
Nothing appears in Userflow
Open your browser console and check for load errors, including Content Security Policy violations. Then confirm in the Network tab that a request fired after sign-in, that your token matches the environment you're viewing, and that no placeholder values were left in the code.
Content shows in the wrong environment
Almost always a token mismatch. Check that each build uses the token for its own environment.
Your MAU count is higher than expected
Check whether identification can run on a public or signed-out page. Ask your agent to review every identify() call site and confirm each one sits behind authentication.
The skill asks for something you don't have
Pause and gather it, or tell the skill you don't have codebase access and it will produce the developer specification instead.
Still stuck
Browse the Userflow documentation, ask your coding agent to explain what it installed, or contact Userflow support.
FAQ
Which coding agents does this work with?
Any agent that can read a SKILL.md file or fetch a URL, including Claude Code, Cursor, GitHub Copilot, Codex, and Windsurf. The skill is plain Markdown.
Is my code or token sent to Userflow?
No. The skill runs entirely inside your coding agent. Your code stays in your environment, and your environment token is used only by the Userflow.js script installed in your project.
Will this cause an MAU overage?
Not with a default install. The skill identifies authenticated users only and never identifies anonymous visitors unless you explicitly ask for that behavior.
Can I run it again later?
Yes. It detects an existing installation and won't duplicate it.
What if I'm not technical?
Use the developer handoff path. The skill produces a complete specification your developer can implement without any further context.
Can I see what the skill actually does?
Yes. Read the full install-with-ai skill on GitHub.
The skill writes real code into your project. Review what your agent produces before merging or deploying. Human oversight is recommended for every installation.