You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/nuxt/README.md
+4-60
Original file line number
Diff line number
Diff line change
@@ -35,69 +35,13 @@
35
35
36
36
### Installation
37
37
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).
39
39
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.
51
41
52
42
## Usage
53
43
54
-
Make sure the following environment variables are set in a `.env` file in your Nuxt project:
Then, add `@clerk/nuxt` to the `modules` section of `nuxt.config.ts`:
62
-
63
-
```js
64
-
exportdefaultdefineNuxtConfig({
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
-
exportdefaulteventHandler(event=> {
89
-
const { userId } =event.context.auth;
90
-
91
-
if (!userId) {
92
-
throwcreateError({
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).
101
45
102
46
## Support
103
47
@@ -122,4 +66,4 @@ _For more information and to report security issues, please refer to our [securi
122
66
123
67
This project is licensed under the **MIT license**.
124
68
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.
Copy file name to clipboardexpand all lines: packages/vue/README.md
+3-53
Original file line number
Diff line number
Diff line change
@@ -35,63 +35,13 @@
35
35
36
36
### Installation
37
37
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).
39
39
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.
51
41
52
42
## Usage
53
43
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:
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).
0 commit comments