Skip to content

Commit e45d455

Browse files
authored
chore(vue,nuxt): Add quickstart links to README (clerk#4883)
1 parent 196f141 commit e45d455

File tree

3 files changed

+13
-113
lines changed

3 files changed

+13
-113
lines changed

.changeset/healthy-bats-rhyme.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@clerk/nuxt": patch
3+
"@clerk/vue": patch
4+
---
5+
6+
Add quickstart links to Vue and Nuxt SDK READMEs

packages/nuxt/README.md

+4-60
Original file line numberDiff line numberDiff line change
@@ -35,69 +35,13 @@
3535

3636
### Installation
3737

38-
Add `@clerk/nuxt` as a dependency
38+
The fastest way to get started with Clerk is by following the [Nuxt Quickstart](https://clerk.com/docs/quickstarts/nuxt?utm_source=github&utm_medium=clerk_nuxt).
3939

40-
```bash
41-
npm install @clerk/nuxt
42-
```
43-
44-
### Build
45-
46-
To build the package locally with the TypeScript compiler, run:
47-
48-
```bash
49-
npm run build
50-
```
40+
You'll learn how to install `@clerk/nuxt`, set up your environment keys, add the Clerk module, and use Clerk's prebuilt components.
5141

5242
## Usage
5343

54-
Make sure the following environment variables are set in a `.env` file in your Nuxt project:
55-
56-
```
57-
NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY=[publishable-key]
58-
NUXT_CLERK_SECRET_KEY=[secret-key]
59-
```
60-
61-
Then, add `@clerk/nuxt` to the `modules` section of `nuxt.config.ts`:
62-
63-
```js
64-
export default defineNuxtConfig({
65-
modules: ['@clerk/nuxt'],
66-
});
67-
```
68-
69-
You can now start using Clerk's components. Here's a basic example showing a header component:
70-
71-
```vue
72-
<template>
73-
<header>
74-
<h1>My App</h1>
75-
<SignedIn>
76-
<UserButton />
77-
</SignedIn>
78-
<SignedOut>
79-
<SignInButton mode="modal" />
80-
</SignedOut>
81-
</header>
82-
</template>
83-
```
84-
85-
To protect an API route, you can access the `event.context.auth` object and check the value of `userId` to determine if the user is authenticated:
86-
87-
```ts
88-
export default eventHandler(event => {
89-
const { userId } = event.context.auth;
90-
91-
if (!userId) {
92-
throw createError({
93-
statusCode: 401,
94-
message: 'Unauthorized',
95-
});
96-
}
97-
98-
return { userId };
99-
});
100-
```
44+
For further information, guides, and examples visit the [Nuxt reference documentation](https://clerk.com/docs/references/nuxt/overview?utm_source=github&utm_medium=clerk_nuxt).
10145

10246
## Support
10347

@@ -122,4 +66,4 @@ _For more information and to report security issues, please refer to our [securi
12266

12367
This project is licensed under the **MIT license**.
12468

125-
See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/vue/LICENSE) for more information.
69+
See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/nuxt/LICENSE) for more information.

packages/vue/README.md

+3-53
Original file line numberDiff line numberDiff line change
@@ -35,63 +35,13 @@
3535

3636
### Installation
3737

38-
Add `@clerk/vue` as a dependency
38+
The fastest way to get started with Clerk is by following the [Vue Quickstart](https://clerk.com/docs/quickstarts/vue?utm_source=github&utm_medium=clerk_vue).
3939

40-
```bash
41-
npm install @clerk/vue
42-
```
43-
44-
### Build
45-
46-
To build the package locally with the TypeScript compiler, run:
47-
48-
```bash
49-
npm run build
50-
```
40+
You'll learn how to create a new Vue application, install `@clerk/vue`, set up your environment keys, add `clerkPlugin`, and use Clerk's prebuilt components.
5141

5242
## Usage
5343

54-
Make sure the following environment variables are set in a `.env.local` file in your Vite project:
55-
56-
```
57-
VITE_CLERK_PUBLISHABLE_KEY=[publishable-key]
58-
```
59-
60-
Then, install the Clerk plugin in your main Vue application:
61-
62-
```js
63-
import { createApp } from 'vue';
64-
import App from './App.vue';
65-
import { clerkPlugin } from '@clerk/vue';
66-
67-
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
68-
69-
const app = createApp(App);
70-
app.use(clerkPlugin, {
71-
publishableKey: PUBLISHABLE_KEY,
72-
});
73-
app.mount('#app');
74-
```
75-
76-
You can now start using Clerk's components. Here's a basic example showing a header component:
77-
78-
```vue
79-
<script setup>
80-
import { SignedIn, SignedOut, UserButton } from '@clerk/vue';
81-
</script>
82-
83-
<template>
84-
<header>
85-
<h1>My App</h1>
86-
<SignedIn>
87-
<UserButton />
88-
</SignedIn>
89-
<SignedOut>
90-
<a href="/sign-in">Sign in</a>
91-
</SignedOut>
92-
</header>
93-
</template>
94-
```
44+
For further information, guides, and examples visit the [Vue reference documentation](https://clerk.com/docs/references/vue/overview?utm_source=github&utm_medium=clerk_vue).
9545

9646
## Support
9747

0 commit comments

Comments
 (0)