Skip to content

Commit daaf770

Browse files
fix: Replace CRA with Vite (clerk#2215)
* fix: Replace CRA with Vite https://github.com/clerk/clerk-docs/pull/518/files * Create ten-nails-whisper.md --------- Co-authored-by: Nikos Douvlis <nikosdouvlis@gmail.com>
1 parent dbb6d7d commit daaf770

File tree

6 files changed

+60
-57
lines changed

6 files changed

+60
-57
lines changed

.changeset/ten-nails-whisper.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

package-lock.json

+51-50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/chrome-extension/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
66
</picture>
77
</a>
8-
<br />
8+
<br />
99
</p>
1010

1111
# @clerk/chrome-extension
@@ -35,7 +35,7 @@ the <a href="https://clerk.com/docs/reference/node/getting-started?utm_source=gi
3535

3636
## Getting Started
3737

38-
To use this package you should first create a Clerk application and retrieve a `Publishable Key` for you application to be used as environment variables `REACT_APP_CLERK_PUBLISHABLE_KEY`.
38+
To use this package you should first create a Clerk application and retrieve a `Publishable Key` for you application to be used as environment variables `VITE_CLERK_PUBLISHABLE_KEY`.
3939

4040
### Prerequisites
4141

@@ -60,7 +60,7 @@ function HelloUser() {
6060
return <p> Hello user</p>;
6161
}
6262

63-
const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY || '';
63+
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY || '';
6464

6565
function ClerkProviderWithRoutes() {
6666
const navigate = useNavigate();

packages/react/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ npm run dev
6161

6262
Clerk requires your application to be wrapped in the `<ClerkProvider/>` context.
6363

64-
If using Create React App, set `REACT_APP_CLERK_PUBLISHABLE_KEY` to your Publishable key in your `.env.local` file to make the environment variable accessible on `process.env` and pass it as the `publishableKey` prop.
64+
If using Vite, set `VITE_CLERK_PUBLISHABLE_KEY` to your Publishable key in your `.env.local` file to make the environment variable accessible on `process.env` and pass it as the `publishableKey` prop.
6565

6666
```jsx
6767
import { render } from 'react-dom';
6868

6969
import { ClerkProvider, SignedIn, SignedOut, SignInButton, UserButton } from '@clerk/clerk-react';
7070

71-
const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY;
71+
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY;
7272

7373
render(
7474
<ClerkProvider publishableKey={publishableKey}>

playground/vite-react-ts/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_REACT_APP_CLERK_PUBLISHABLE_KEY=pk_test_************
1+
VITE_CLERK_PUBLISHABLE_KEY=pk_test_************

playground/vite-react-ts/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from '@clerk/clerk-react';
1616
import { BrowserRouter, Route, Routes, useNavigate } from 'react-router-dom';
1717

18-
const clerkPubKey = import.meta.env.VITE_REACT_APP_CLERK_PUBLISHABLE_KEY;
18+
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
1919

2020
function NavBar() {
2121
return (

0 commit comments

Comments
 (0)