diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..70a29153 --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# change this to your production url when deploying +NEXT_PUBLIC_BASE_URL="http://localhost:3000" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5ef6a520..7b8da95f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example # vercel .vercel diff --git a/README.md b/README.md index 4308025e..414744fb 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,18 @@ This is a template for creating a custom registry using Next.js. - Every registry item are compatible with the `shadcn` CLI. - We have also added v0 integration using the `Open in v0` api. +## Environment Configuration + +For the "Open in v0" feature to work properly, you need to set the correct deployment URL: + +1. Copy `.env.example` to `.env` +2. Update `NEXT_PUBLIC_BASE_URL` to your deployed registry URL (e.g., `https://registry-template.vercel.app`) + +```bash +cp .env.example .env +# Edit .env and set NEXT_PUBLIC_BASE_URL to your deployment URL +``` + ## Documentation Visit the [shadcn documentation](https://ui.shadcn.com/docs/registry) to view the full documentation.