Skip to content

Commit

Permalink
fix: Replace CRA with Vite (#2215)
Browse files Browse the repository at this point in the history
* fix: Replace CRA with Vite

https://github.com/clerk/clerk-docs/pull/518/files

* Create ten-nails-whisper.md

---------

Co-authored-by: Nikos Douvlis <[email protected]>
  • Loading branch information
SokratisVidros and nikosdouvlis authored Nov 27, 2023
1 parent dbb6d7d commit daaf770
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .changeset/ten-nails-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
101 changes: 51 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/chrome-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
</picture>
</a>
<br />
<br />
</p>

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

## Getting Started

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`.
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`.

### Prerequisites

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

const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY || '';
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY || '';

function ClerkProviderWithRoutes() {
const navigate = useNavigate();
Expand Down
4 changes: 2 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ npm run dev

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

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.
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.

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

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

const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY;
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY;

render(
<ClerkProvider publishableKey={publishableKey}>
Expand Down
2 changes: 1 addition & 1 deletion playground/vite-react-ts/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_REACT_APP_CLERK_PUBLISHABLE_KEY=pk_test_************
VITE_CLERK_PUBLISHABLE_KEY=pk_test_************
2 changes: 1 addition & 1 deletion playground/vite-react-ts/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@clerk/clerk-react';
import { BrowserRouter, Route, Routes, useNavigate } from 'react-router-dom';

const clerkPubKey = import.meta.env.VITE_REACT_APP_CLERK_PUBLISHABLE_KEY;
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

function NavBar() {
return (
Expand Down

0 comments on commit daaf770

Please sign in to comment.