@replohq/sdk yourself. Every Replo site already has it, and Replo keeps the version current.
How it gets there
The SDK is a published npm package, and Replo adds it to your site’spackage.json and installs it for you. When a new version ships, sites move to it automatically. You do not need to bump a version or run an install to pick up a fix.
That means two things when you are editing site code:
- Import it without adding a dependency. The package is already present.
- 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.
Peer dependencies
The SDK expects the site to provide these. A site scaffolded by Replo already satisfies them:
React Query is what the data loaders read from, which is why
ReploProvider has to wrap your app before any loader renders. See Setup.
Checking the version
BUILD_METADATA reports the package version the running site was built against:
Working on the site locally
Clone the repository, install, and run the dev server as you would any Next.js app:Next steps
Setup reference
The provider, config, and script tags a site mounts once.
Data loaders
Render store data on a page.