@replohq/sdk as a dependency when you edit site code. Replo keeps the version current after that.
How it gets there
The SDK is a published npm package. Put it in the site’spackage.json and install it:
- Add it as a dependency. List
@replohq/sdkinpackage.jsonbefore you import from it. - Do not pin it. Replacing the managed version with a fixed one stops your site from receiving fixes, and Replo will move it back on the next update.
Working on the site locally
First use the versions declared by the checkout, such aspackageManager,
engines, .nvmrc, or .node-version. If none of those files declares a
version, use Node.js 22 and pnpm 10.
Then install and run the dev server as you would any Next.js app:
env -u REPLO_API_KEY removes the Git-only key from that child command while
the parent shell keeps it for later Git commands. Use the prefix each time you
launch the dev server, including after a restart.
pnpm dev runs Next.js with Turbopack. If you switch to webpack with next dev --webpack, watch for this macOS failure:
The webpack dev server is Ready but every route returns 404 on macOS
The webpack dev server is Ready but every route returns 404 on macOS
Check the dev server output for
Polling picks up edits a few seconds later than native watching, so turn it
on only when you see this error. The error affects only your local dev
server, not your published site.
Watchpack Error (watcher): Error: EMFILE: too many open files, watch.
Webpack’s native file watcher failed, so Next.js treats your source
folders as missing and serves only its 404 page. Stop the dev server, then
restart it from the site folder with polling:Remove an existing local development cache
As a precaution, if you previously started the dev server whileREPLO_API_KEY
was exported, stop the server. From the site root, delete its local development
cache:
env -u REPLO_API_KEY pnpm dev. The next start recompiles the site.
Next steps
Setup reference
The provider, config, and script tags a site mounts once.
Data loaders
Render store data on a page.