Skip to content

Commit 6d3c66d

Browse files
authored
feat(astro,vue,nuxt): Introduce APIKeys component (#7225)
1 parent 1d4e7a7 commit 6d3c66d

File tree

9 files changed

+43
-1
lines changed

9 files changed

+43
-1
lines changed

.changeset/gentle-hats-hope.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@clerk/astro": minor
3+
"@clerk/nuxt": minor
4+
"@clerk/vue": minor
5+
---
6+
7+
Introduce `<APIKeys />` component

packages/astro/src/astro-components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ export { default as CreateOrganization } from './interactive/CreateOrganization.
3131
export { default as GoogleOneTap } from './interactive/GoogleOneTap.astro';
3232
export { default as Waitlist } from './interactive/Waitlist.astro';
3333
export { default as PricingTable } from './interactive/PricingTable.astro';
34+
export { default as APIKeys } from './interactive/APIKeys.astro';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
import type { APIKeysProps } from '@clerk/shared/types';
3+
type Props = APIKeysProps;
4+
5+
import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro';
6+
---
7+
8+
<InternalUIComponentRenderer
9+
{...Astro.props}
10+
component='api-keys'
11+
/>

packages/astro/src/internal/mount-clerk-astro-js-components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const mountAllClerkAstroJSComponents = () => {
2020
'google-one-tap': 'openGoogleOneTap',
2121
waitlist: 'mountWaitlist',
2222
'pricing-table': 'mountPricingTable',
23+
'api-keys': 'mountAPIKeys',
2324
} as const satisfies Record<InternalUIComponentId, keyof Clerk>;
2425

2526
Object.entries(mountFns).forEach(([category, mountFn]) => {

packages/astro/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ export type InternalUIComponentId =
7272
| 'user-profile'
7373
| 'google-one-tap'
7474
| 'waitlist'
75-
| 'pricing-table';
75+
| 'pricing-table'
76+
| 'api-keys';

packages/nuxt/src/module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ export default defineNuxtModule<ModuleOptions>({
169169
'SignedIn',
170170
'SignedOut',
171171
'Waitlist',
172+
// API Keys Components
173+
'APIKeys',
172174
];
173175
components.forEach(component => {
174176
void addComponent({

packages/nuxt/src/runtime/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ export {
3030
SignOutButton,
3131
SignInWithMetamaskButton,
3232
PricingTable,
33+
APIKeys,
3334
} from '@clerk/vue';

packages/vue/src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export { default as Waitlist } from './ui-components/Waitlist.vue';
55
export { default as CreateOrganization } from './ui-components/CreateOrganization.vue';
66
export { default as OrganizationList } from './ui-components/OrganizationList.vue';
77
export { default as PricingTable } from './ui-components/PricingTable.vue';
8+
export { default as APIKeys } from './ui-components/APIKeys.vue';
89
export { UserProfile } from './ui-components/UserProfile';
910
export { OrganizationProfile } from './ui-components/OrganizationProfile';
1011
export { OrganizationSwitcher } from './ui-components/OrganizationSwitcher';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script setup lang="ts">
2+
import { ClerkHostRenderer } from '../ClerkHostRenderer';
3+
import type { APIKeysProps } from '@clerk/shared/types';
4+
import { useClerk } from '../../composables';
5+
6+
const clerk = useClerk();
7+
const props = defineProps<APIKeysProps>();
8+
</script>
9+
10+
<template>
11+
<ClerkHostRenderer
12+
:mount="clerk?.mountAPIKeys"
13+
:unmount="clerk?.unmountAPIKeys"
14+
:update-props="(clerk as any)?.__unstable__updateProps"
15+
:props="props"
16+
/>
17+
</template>

0 commit comments

Comments
 (0)