Skip to content

About

The Complete Nuxt Starter package offers a sample project that demonstrates how simple it is to create compelling web pages in Prepr, including personalization and A/B testing capabilities.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Repository files navigation

Nuxt Complete Starter

Check out the Complete guide to Nuxt and Prepr to learn more.

Setup

Make sure to install the dependencies:

# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

Add the environment file

Copy the .env.example file in this directory to .env (which will be ignored by Git) by running the following command:

cp .env.example .env

Update the environment file

In the .env file, replace <YOUR_PREPR_GRAPHQL_URL> with the API URL of the Prepr GraphQL Preview access token from your Acme Lease Demo environment.

preview API URL

npm run codegen (also run automatically as part of npm run build) regenerates the GraphQL types in app/gql/ from this schema, reading NUXT_PREPR_GRAPHQL_URL from .env.

Set NUXT_PREPR_ENV=preview to show the Prepr preview toolbar (and let query params override segments/variants); set it to production to hide the toolbar and lock the page down to production content. Both variables are Nuxt runtime config overrides, so in a deployed environment set them on the host at runtime — they're server-only and never baked into the build.

typescript is pinned to ^6 because vue-tsc doesn't yet support TypeScript 7 — bumping it without also bumping vue-tsc will break npm run typecheck.

Development Server

Start the development server on http://localhost:3000

npm run dev

Production

Build the application for production:

npm run build

Start the production build:

npm run start

This runs node --env-file-if-exists=.env .output/server/index.mjs, which serves the app with Nitro's Node.js preset and loads .env if one is present (host-provided environment variables still take precedence).

Check out the deployment documentation for more information.

The Prepr Toolkit's Nuxt middleware needs Nitro's Node.js runtime (the default). Deploying to an edge runtime such as Cloudflare Workers is not supported.

About

The Complete Nuxt Starter package offers a sample project that demonstrates how simple it is to create compelling web pages in Prepr, including personalization and A/B testing capabilities.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Packages

Used by

Contributors

Languages