@preprio/toolkit
| Install | |
|---|---|
npm install @preprio/toolkit |
|
| Latest Version: | 0.4.3 |
| Vue: | 3 |
| License: | Apache-2.0 |
| Last Updated: | Oct 21, 2026 |
| Links: | GitHub · npm |
Prepr Toolkit
A framework-agnostic TypeScript library that provides preview functionality, visual editing, and A/B testing for Prepr CMS. One vanilla core, with thin wrappers for React, Next.js, Nuxt, Astro, and SvelteKit.
This is the monorepo. The published package lives in packages/toolkit — its README is the user-facing documentation: quick start, per-framework guides, and the complete API reference.
Quick Start
npm install @preprio/toolkit
Then follow the Quick Start for your framework: Next.js, Astro, SvelteKit, Nuxt, React, or anything else.
Upgrading from the old Next.js-only @preprio/prepr-nextjs package? See the migration guide.
What's In Here
| Path | Description |
|---|---|
packages/toolkit |
The published @preprio/toolkit package — vanilla core plus the Next.js, Nuxt, Astro, and SvelteKit wrappers. |
examples/nextjs |
App Router, middleware, Apollo Client, custom image loader. |
examples/astro |
Astro middleware and the .astro components. |
examples/sveltekit |
hooks.server.ts, +layout.server.ts, the .svelte components. |
examples/nuxt |
Nitro middleware, runtimeConfig, the .vue components. |
examples/express |
Vanilla core — a hand-written adapter for an unsupported framework. |
MIGRATION.md |
Upgrading from @preprio/prepr-nextjs to @preprio/toolkit. |
A pnpm workspace (packages/*, examples/*) built with Turborepo.
Running the Examples
Each example needs its own .env. Copy the template and fill in your Prepr GraphQL URL (Settings → Access tokens in Prepr):
cp examples/nextjs/.env.example examples/nextjs/.env
Install once at the root, build the package, then start the example you want:
pnpm install
pnpm build
pnpm --filter example-nextjs dev
The other examples follow the same pattern — example-astro, example-sveltekit, example-nuxt, example-express.
Development
pnpm install # install all workspace dependencies
pnpm build # build the published packages
pnpm test # run the test suites
pnpm typecheck # typecheck the published packages
These cover packages/* only — they are what the release workflow runs, so a release is never blocked by an example. The examples have their own commands:
pnpm build:examples # build every example
pnpm typecheck:examples # typecheck every example
pnpm check:all # everything, packages and examples
The examples build and typecheck without a .env (examples/sveltekit reads PUBLIC_PREPR_GRAPHQL_URL through $env/dynamic/public at runtime, so nothing has to exist at compile time). They stay out of the release path anyway: a broken example should never block publishing the packages.
All commands run through Turborepo, so they are cached and only re-run what changed. To scope one to a single workspace:
pnpm --filter @preprio/toolkit test
The toolbar's CSS is compiled from .css sources into *.generated.ts files by scripts/compile-css.mjs. This runs automatically before build, test, and typecheck — the generated files are gitignored, so a fresh clone has none until you run one of those commands.
There is no CI on pushes or pull requests: checks run only when you push a v* tag, as the first half of the Release workflow. Nothing verifies a branch for you, so run pnpm check:all locally before you push — a mistake that reaches main stays invisible until someone cuts a release.
Releasing
Push a v* tag and the Release workflow lints, typechecks, tests, builds and publishes to npm. See RELEASING.md for the full walkthrough.
Support
- Documentation: Prepr Documentation
- Support: Prepr Support
Related Packages
Create a blog wired to ContioReach in one command. Pick Next.js, Nuxt, Astro, Sv...
Live preview for Payload CMS on server-rendered and static frontends: DOM patche...
Official JavaScript SDK for Cosmic. Fetch content, manage media, and generate AI...
Version History
| Version | Released | License |
|---|---|---|
| 0.4.3 | Apache-2.0 | |
| 0.4.2 | Apache-2.0 | |
| 0.4.1 | Apache-2.0 | |
| 0.4.0 | Apache-2.0 | |
| 0.3.5 | Apache-2.0 | |
| 0.3.4 | Apache-2.0 | |
| 0.3.2 | Apache-2.0 | |
| 0.2.0 | Apache-2.0 |
Pre-releases (25)
| Version | Released | License |
|---|---|---|
| 0.6.0-alpha.10 | Apache-2.0 | |
| 0.6.0-alpha.9 | Apache-2.0 | |
| 0.6.0-alpha.8 | Apache-2.0 | |
| 0.6.0-alpha.7 | Apache-2.0 | |
| 0.6.0-alpha.6 | Apache-2.0 | |
| 0.6.0-alpha.5 | Apache-2.0 | |
| 0.6.0-alpha.4 | Apache-2.0 | |
| 0.6.0-alpha.3 | Apache-2.0 | |
| 0.6.0-alpha.2 | Apache-2.0 | |
| 0.6.0-alpha.1 | Apache-2.0 | |
| 0.6.0-alpha.0 | Apache-2.0 | |
| 0.5.0-rc.2 | Apache-2.0 | |
| 0.5.0-rc.1 | Apache-2.0 | |
| 0.2.0-beta.9 | Apache-2.0 | |
| 0.2.0-beta.7 | Apache-2.0 | |
| 0.2.0-beta.6 | Apache-2.0 | |
| 0.2.0-beta.5 | Apache-2.0 | |
| 0.2.0-beta.4 | Apache-2.0 | |
| 0.2.0-beta.3 | Apache-2.0 | |
| 0.2.0-beta.2 | Apache-2.0 | |
| 0.1.0-beta.6 | Apache-2.0 | |
| 0.1.0-beta.5 | Apache-2.0 | |
| 0.1.0-beta.4 | MIT | |
| 0.1.0-beta.3 | MIT | |
| 0.1.0-beta.1 | MIT |