AIML.chat Next.js Setup is a free, MIT-licensed agent skill that adds the widget to a Next.js App Router project the right way, so your AI chat loads without hydration warnings or being stripped by the build. Point your agent at it and your Next.js app has a grounded assistant in minutes.
What it does
The skill places the AIML.chat embed using Next.js's supported pattern — the Script component with the correct loading strategy in the root layout — so it loads after hydration and doesn't trip React's mismatch checks. It wires your publishable site key from an environment variable, keeping the key out of source, and sets the widget's appearance. It then points you at indexing your site or content so the agent answers from your real pages with citations. Because App Router renders on the server, the skill ensures the script runs client-side at the right moment rather than during SSR.
The skill
name: aiml-nextjs-setup
Use when adding AIML.chat to a Next.js App Router site.
Steps:
1. Put your publishable site key in an env var (NEXT_PUBLIC_AIML_KEY).
2. Add the embed via next/script with a client loading strategy in the root layout.
3. Pass appearance/position; run the app and confirm the widget loads.
4. Index the site or content in AIML.chat; schedule a re-crawl as it changes.
How to use it
Copy the SKILL.md into your agent framework's skills folder and run it on a Next.js project, or follow the steps manually. It pairs with the Docusaurus setup skill for static docs, and the SaaS use case explains what the agent does once live. The integrations overview covers other frameworks.
Ready to install? Start free, grab your site key, and your app gets an AI assistant in minutes — see pricing for limits.
Will it cause hydration warnings?+
No — it uses next/script with a client loading strategy so the embed runs after hydration, avoiding mismatch warnings.
Is my site key exposed?+
The publishable key is meant to be public, but the skill stores it in an env var to keep your code clean.
Is the skill free?+
Yes — it is MIT-licensed and free to copy. Using the widget counts toward your plan's limits; see pricing.