Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vue,nuxt): Add Vue and Nuxt SDK docs #1710

Merged
merged 26 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1970bff
docs(vue): Add initial references and migration guide
wobsoriano Nov 14, 2024
24f9b0b
docs(vue): Update overview
wobsoriano Nov 20, 2024
aae7ec4
docs(vue): Remove react reference
wobsoriano Nov 20, 2024
56bf33d
docs(vue): Update migration guide
wobsoriano Nov 20, 2024
e002380
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 12, 2024
fe61e86
update
victoriaxyz Dec 12, 2024
2d72b2c
fix highlighting
wobsoriano Dec 12, 2024
1aec4f4
update
victoriaxyz Dec 12, 2024
b94cd13
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 12, 2024
0cd383a
remove link, pending previous pr approval
victoriaxyz Dec 12, 2024
005d91e
feat(vue): Introduce Vue SDK Quickstart (#1709)
wobsoriano Dec 13, 2024
7954eae
code review
alexisintech Dec 13, 2024
fd2ab5c
feat(vue): Add client-side helpers (#1711)
wobsoriano Dec 16, 2024
b9c2e0e
feat(vue): Add client helpers (part 2) (#1712)
wobsoriano Dec 16, 2024
bdd1280
fix broken link
alexisintech Dec 16, 2024
7dd3ba6
Apply suggestions from code review
victoriaxyz Dec 16, 2024
1cf729f
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 16, 2024
beea2ce
Update docs/quickstarts/vue.mdx
victoriaxyz Dec 16, 2024
aead41f
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 16, 2024
f97b80b
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 18, 2024
2569e26
Merge branch 'main' into rob/eco-224-vue-sdk-references
victoriaxyz Dec 18, 2024
2aefa83
feat(nuxt): Add Nuxt SDK docs (#1728)
wobsoriano Dec 19, 2024
5cf88b9
Merge branch 'main' into rob/eco-224-vue-sdk-references
wobsoriano Dec 19, 2024
b0aadae
Merge branch 'main' into rob/eco-224-vue-sdk-references
alexisintech Dec 20, 2024
6c08860
final review
alexisintech Dec 20, 2024
5798552
Merge branch 'main' into rob/eco-224-vue-sdk-references
wobsoriano Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,74 @@
]
]
},
{
"title": "Vue",
"collapse": true,
"icon": "vue",
"items": [
[
{ "title": "Overview", "href": "/docs/references/vue/overview" },
{
"title": "Guides",
"items": [
[
{
"title": "Migrating from community SDK",
"href": "/docs/references/vue/migrating-from-vue-community-sdk"
}
]
]
},
{
"title": "Client-side Helpers",
"items": [
[
{
"title": "`useUser()`",
"wrap": false,
"href": "/docs/references/vue/use-user"
},
{
"title": "`useClerk()`",
"wrap": false,
"href": "/docs/references/vue/use-clerk"
},
{
"title": "`useAuth()`",
"wrap": false,
"href": "/docs/references/vue/use-auth"
},
{
"title": "`useSignIn()`",
"wrap": false,
"href": "/docs/references/vue/use-sign-in"
},
alexisintech marked this conversation as resolved.
Show resolved Hide resolved
{
"title": "`useSignUp`",
"wrap": false,
"href": "/docs/references/vue/use-sign-up"
},
{
"title": "`useSession()`",
"wrap": false,
"href": "/docs/references/vue/use-session"
},
{
"title": "`useSessionList()`",
"wrap": false,
"href": "/docs/references/vue/use-session-list"
},
{
"title": "`useOrganization()`",
"wrap": false,
"href": "/docs/references/vue/use-organization"
}
alexisintech marked this conversation as resolved.
Show resolved Hide resolved
]
]
}
]
]
},
{
"title": "Ruby / Rails",
"collapse": true,
Expand Down
55 changes: 55 additions & 0 deletions docs/references/vue/migrating-from-vue-community-sdk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: 'Migrating from the Vue community SDK'
description: Learn how to migrate from the Vue community SDK to the Clerk Vue SDK.
---

In December 2024, we introduced official support for Vue. This migration guide covers converting from the [`vue-clerk`](https://vue-clerk.vercel.app) community SDK to Clerk's official SDK. It covers the breaking changes that were introduced and provides examples on how to resolve them.

## Installation

Uninstall the community SDK and install Clerk's new official SDK for Vue.

<CodeBlockTabs options={["npm", "yarn", "pnpm"]}>
```bash {{ filename: 'terminal' }}
npm uninstall vue-clerk
npm install @clerk/vue
```

```bash {{ filename: 'terminal' }}
yarn remove vue-clerk
yarn add @clerk/vue
```

```bash {{ filename: 'terminal' }}
pnpm remove vue-clerk
pnpm add @clerk/vue
```
</CodeBlockTabs>

## Breaking Changes

### The `useClerk()` composable

The composable now returns a Vue [Ref](https://vuejs.org/api/reactivity-core.html#ref) containing the Clerk instance, rather than returning the instance directly.

Since it now returns a `Ref`, you can update your code as follows:

```vue {{ del: [2, 9], ins: [3, [8, 9]] }}
<script setup>
import { useClerk } from 'vue-clerk'
import { useClerk } from '@clerk/vue'

const clerk = useClerk()

function signIn() {
clerk.openSignIn()
clerk.value.openSignIn()
}
</script>

<template>
<button @click="signIn">Sign in</button>
</template>
```

Everything else should work as expected - just make sure to replace all `vue-clerk` imports with `@clerk/vue`.
19 changes: 19 additions & 0 deletions docs/references/vue/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Clerk Vue SDK
description: Learn how to use Clerk to quickly and easily add secure authentication and user management to your Vue application.
---

The Clerk Vue SDK is a wrapper around the Clerk JavaScript SDK. It is the recommended way to integrate Clerk into your Vue application.

> [!IMPORTANT]
> If you're using Nuxt, we recommend installing the `@clerk/nuxt` package since it's specifically built as a Nuxt module and includes backend integration. See the [Nuxt](/docs/references/nuxt/overview) documentation for more information.
wobsoriano marked this conversation as resolved.
Show resolved Hide resolved

Clerk Vue provides Vue implementations of [Clerk components](/docs/components/overview); highly customizable, prebuilt components that you can use to build beautiful user management applications. You can find display components for building [sign-in](/docs/components/authentication/sign-in), [sign-up](/docs/components/authentication/sign-up), [account switching](/docs/components/user/user-button), and [user profile management](/docs/components/user/user-profile) pages as well as flow [control components](/docs/components/control/signed-in) that act as helpers for implementing a seamless authentication experience.

Clerk Vue provides a suite of [custom composables](/docs/references/vue/use-user). These composables give you access to the [`Clerk` object](/docs/references/javascript/clerk/clerk), and a set of useful helper methods for signing in and signing up.

## Setting up Clerk Vue

You need to create a Clerk application in your Clerk Dashboard before you can set up Clerk Vue. For more information, check out [the dedicated guide.](/docs/quickstarts/setup-clerk)

Once a Clerk application has been created, you can install and start using Clerk Vue in your application. [The quickstart guide](/docs/quickstarts/vue) will have all the information you need to get started.
wobsoriano marked this conversation as resolved.
Show resolved Hide resolved
Loading