@providame/vue 0.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/components/Protect.vue.d.ts +18 -0
  4. package/dist/components/RedirectToSignIn.vue.d.ts +6 -0
  5. package/dist/components/ResetPassword.vue.d.ts +23 -0
  6. package/dist/components/SignIn.vue.d.ts +23 -0
  7. package/dist/components/SignInButton.vue.d.ts +25 -0
  8. package/dist/components/SignOutButton.vue.d.ts +16 -0
  9. package/dist/components/SignUp.vue.d.ts +29 -0
  10. package/dist/components/SignUpButton.vue.d.ts +25 -0
  11. package/dist/components/SignedIn.vue.d.ts +13 -0
  12. package/dist/components/SignedOut.vue.d.ts +13 -0
  13. package/dist/components/UserButton.vue.d.ts +12 -0
  14. package/dist/components/UserProfile.vue.d.ts +12 -0
  15. package/dist/components/internal/EmailSection.vue.d.ts +7 -0
  16. package/dist/components/internal/Overlay.vue.d.ts +34 -0
  17. package/dist/components/internal/PhoneSection.vue.d.ts +3 -0
  18. package/dist/components/internal/ProfileSection.vue.d.ts +7 -0
  19. package/dist/components/internal/SecuritySection.vue.d.ts +3 -0
  20. package/dist/components/internal/TurnstileWidget.vue.d.ts +10 -0
  21. package/dist/composables/useAuth.d.ts +12 -0
  22. package/dist/composables/useBranding.d.ts +14 -0
  23. package/dist/composables/usePasskeyRegistrationLink.d.ts +24 -0
  24. package/dist/composables/useResetPassword.d.ts +34 -0
  25. package/dist/composables/useSession.d.ts +23 -0
  26. package/dist/composables/useSignIn.d.ts +57 -0
  27. package/dist/composables/useSignInIdp.d.ts +23 -0
  28. package/dist/composables/useSignUp.d.ts +30 -0
  29. package/dist/composables/useUser.d.ts +10 -0
  30. package/dist/index.d.ts +24 -0
  31. package/dist/plugin.d.ts +20 -0
  32. package/dist/providame-vue.cjs +1 -0
  33. package/dist/providame-vue.css +2 -0
  34. package/dist/providame-vue.js +5716 -0
  35. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Avanest
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @providame/vue
2
+
3
+ Vue 3 bindings for Providame — headless composables (build your own UI) and prebuilt components (drop-in), both over the same `@providame/core` engine.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @providame/vue vue
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Install the plugin once, then import the CSS for the prebuilt components:
14
+
15
+ ```ts
16
+ import { createApp } from 'vue'
17
+ import { ProvidamePlugin } from '@providame/vue'
18
+ import '@providame/vue/style.css'
19
+
20
+ createApp(App).use(ProvidamePlugin, {
21
+ publishableKey: 'pk_test_...',
22
+ })
23
+ ```
24
+
25
+ ### Prebuilt components
26
+
27
+ ```vue
28
+ <script setup>
29
+ import { SignIn } from '@providame/vue'
30
+ </script>
31
+
32
+ <template>
33
+ <SignIn sign-up-url="/sign-up" @complete="onComplete" />
34
+ </template>
35
+ ```
36
+
37
+ ### Headless
38
+
39
+ ```ts
40
+ import { useSignIn } from '@providame/vue'
41
+
42
+ const signIn = useSignIn()
43
+ await signIn.signInWithPassword('user@example.com', 'password')
44
+ ```
45
+
46
+ ## Build
47
+
48
+ ```bash
49
+ npm run build
50
+ ```
@@ -0,0 +1,18 @@
1
+ type __VLS_Props = {
2
+ role?: string;
3
+ };
4
+ declare var __VLS_1: {}, __VLS_3: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ } & {
8
+ fallback?: (props: typeof __VLS_3) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ signInUrl: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import "../styles.css";
2
+ import { type Appearance } from "@providame/core";
3
+ type __VLS_Props = {
4
+ /** Heading shown above the form. */
5
+ title?: string;
6
+ /** Subtitle shown under the title. */
7
+ subtitle?: string;
8
+ /** Logo image URL, rendered centered above the title. */
9
+ logo?: string;
10
+ /** Link target for the "back to sign in" prompt. */
11
+ signInUrl?: string;
12
+ appearance?: Appearance;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ complete: (session: import("@providame/core").Session) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onComplete?: ((session: import("@providame/core").Session) => any) | undefined;
18
+ }>, {
19
+ title: string;
20
+ signInUrl: string;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import "../styles.css";
2
+ import { type Appearance } from "@providame/core";
3
+ type __VLS_Props = {
4
+ /** Heading shown above the form. */
5
+ title?: string;
6
+ /** Subtitle shown under the title. */
7
+ subtitle?: string;
8
+ /** Logo image URL, rendered centered above the title. */
9
+ logo?: string;
10
+ /** Link target for the "create account" prompt. */
11
+ signUpUrl?: string;
12
+ appearance?: Appearance;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
+ complete: (session: import("@providame/core").Session) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onComplete?: ((session: import("@providame/core").Session) => any) | undefined;
18
+ }>, {
19
+ title: string;
20
+ signUpUrl: string;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
@@ -0,0 +1,25 @@
1
+ type __VLS_Props = {
2
+ mode?: "modal" | "redirect";
3
+ signInUrl?: string;
4
+ signUpUrl?: string;
5
+ };
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ complete: (session: unknown) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onComplete?: ((session: unknown) => any) | undefined;
14
+ }>, {
15
+ signInUrl: string;
16
+ mode: "modal" | "redirect";
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ redirectUrl?: string;
3
+ };
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,29 @@
1
+ import "../styles.css";
2
+ import { type Appearance } from "@providame/core";
3
+ type __VLS_Props = {
4
+ title?: string;
5
+ /** Subtitle shown under the title. */
6
+ subtitle?: string;
7
+ /** Logo image URL, rendered centered above the title. */
8
+ logo?: string;
9
+ signInUrl?: string;
10
+ /** Collect first/last name fields. */
11
+ collectName?: boolean;
12
+ /** Invite code for an invite_only signup-policy environment — threaded
13
+ * to CreateSignUpParams.inviteToken. Read this from your own app's URL
14
+ * (e.g. an invite-accept page's query param) or wherever your invite
15
+ * flow surfaces it. */
16
+ inviteToken?: string;
17
+ appearance?: Appearance;
18
+ };
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
20
+ complete: (session: import("@providame/core").Session) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onComplete?: ((session: import("@providame/core").Session) => any) | undefined;
23
+ }>, {
24
+ title: string;
25
+ signInUrl: string;
26
+ collectName: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
@@ -0,0 +1,25 @@
1
+ type __VLS_Props = {
2
+ mode?: "modal" | "redirect";
3
+ signUpUrl?: string;
4
+ signInUrl?: string;
5
+ };
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ complete: (session: unknown) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onComplete?: ((session: unknown) => any) | undefined;
14
+ }>, {
15
+ signUpUrl: string;
16
+ mode: "modal" | "redirect";
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,12 @@
1
+ import "../styles.css";
2
+ import { type Appearance } from "@providame/core";
3
+ type __VLS_Props = {
4
+ appearance?: Appearance;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
+ signOut: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onSignOut?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import "../styles.css";
2
+ import { type Appearance } from "@providame/core";
3
+ type __VLS_Props = {
4
+ appearance?: Appearance;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
+ close: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { UseUser } from "../../composables/useUser.js";
2
+ type __VLS_Props = {
3
+ user: UseUser;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import "../../styles.css";
2
+ type __VLS_Props = {
3
+ open: boolean;
4
+ closeOnEscape?: boolean;
5
+ closeOnBackdrop?: boolean;
6
+ /** Accessible name for the dialog — required since role="dialog" alone
7
+ * gives assistive tech nothing to announce. */
8
+ ariaLabel?: string;
9
+ /** Explicit element to restore focus to on close, overriding the
10
+ * auto-captured document.activeElement below. Needed when the element
11
+ * that triggered the open (e.g. a dropdown menu item) is itself removed
12
+ * from the DOM as a side effect of opening (closing the menu) — restoring
13
+ * focus to a now-detached node is a silent no-op, so a caller in that
14
+ * situation (see UserButton.vue) should pass its own stable trigger
15
+ * element instead. */
16
+ restoreFocusTo?: HTMLElement | null;
17
+ };
18
+ declare var __VLS_7: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_7) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
+ close: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onClose?: (() => any) | undefined;
26
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { UseUser } from "../../composables/useUser.js";
2
+ type __VLS_Props = {
3
+ user: UseUser;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ siteKey: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
+ token: (token: string) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
7
+ onToken?: ((token: string) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { type Ref } from "vue";
2
+ export interface UseAuth {
3
+ isLoaded: Ref<boolean>;
4
+ isSignedIn: Ref<boolean>;
5
+ userId: Ref<string | null>;
6
+ /** Decoded access-token claims (display/gating only — never verified client-side). */
7
+ sessionClaims: Ref<Record<string, unknown> | null>;
8
+ getToken(): Promise<string | null>;
9
+ signOut(): Promise<void>;
10
+ }
11
+ /** Clerk-shaped auth-state hook, built on the existing useSession()/client. */
12
+ export declare function useAuth(): UseAuth;
@@ -0,0 +1,14 @@
1
+ import type { Branding } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ /**
4
+ * Fetches this environment's Branding settings (colors/logo) and applies
5
+ * the colors as global CSS custom properties — every prebuilt component
6
+ * calls this on mount so a page with only one of them (e.g. just
7
+ * <UserButton>) still picks up branding; the underlying fetch is memoized
8
+ * on the Providame client (see Providame.branding()), so mounting several
9
+ * components on one page costs a single request, not one per component.
10
+ * Returns the fetched Branding so <SignIn>/<SignUp>/<ResetPassword> can
11
+ * default their `logo` prop to `branding.value.logoUrl` when no explicit
12
+ * logo was passed.
13
+ */
14
+ export declare function useBranding(): Ref<Branding>;
@@ -0,0 +1,24 @@
1
+ export interface UsePasskeyRegistrationLink {
2
+ registerWithCode(identifier: string, codeId: string, code: string, domain: string): Promise<{
3
+ passkeyId: string;
4
+ creationOptions: Record<string, unknown>;
5
+ }>;
6
+ verifyWithCode(passkeyId: string, identifier: string, credential: Record<string, unknown>, name: string): Promise<void>;
7
+ }
8
+ /**
9
+ * Thin wrapper around the admin-initiated passkey registration-link flow
10
+ * (`PasskeysApi.registerWithCode`/`verifyWithCode` in `@providame/core`) —
11
+ * the code-based flow a user who isn't currently signed in completes from
12
+ * the landing page an admin-emailed registration link points at. See
13
+ * `PasskeysApi.registerWithCode`'s doc comment in `@providame/core` for the
14
+ * full flow (driving `navigator.credentials.create()` between the two
15
+ * calls) and its error-handling note.
16
+ *
17
+ * Unlike `useAuth()`/`useUser()`, this is stateless — there's no signed-in
18
+ * session to track between calls — so it's a plain passthrough to the
19
+ * already-injected `Providame` client, exposed as a composable purely for
20
+ * discoverability/consistency with this package's other `use*` exports.
21
+ * `useProvidame().user.passkeys.registerWithCode`/`verifyWithCode` work
22
+ * identically without this composable.
23
+ */
24
+ export declare function usePasskeyRegistrationLink(): UsePasskeyRegistrationLink;
@@ -0,0 +1,34 @@
1
+ import { ProvidameError, type EnrollTotpResponse, type ResetPasswordAttemptParams, type SecondFactorParams, type Session, type StartResetPasswordParams } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseResetPassword {
4
+ /** Current flow status; "idle" before create(). */
5
+ status: Ref<string>;
6
+ /** True while a request is in flight. */
7
+ loading: Ref<boolean>;
8
+ /** Last error, or null. */
9
+ error: Ref<ProvidameError | null>;
10
+ /** The session, once complete. */
11
+ session: Ref<Session | null>;
12
+ /** True once the new password has been set and the user signed in. */
13
+ isComplete: Ref<boolean>;
14
+ /** Secret + otpauth URI for a pending mid-flow TOTP enrollment. */
15
+ enrollment: Ref<EnrollTotpResponse | null>;
16
+ /** One-time backup codes, populated right after a mid-flow TOTP enrollment. */
17
+ recoveryCodes: Ref<string[] | null>;
18
+ create(params: StartResetPasswordParams): Promise<void>;
19
+ attempt(params: ResetPasswordAttemptParams): Promise<void>;
20
+ /** Submits the second factor (TOTP or a backup code) for an MFA-protected account. */
21
+ attemptSecondFactor(params: SecondFactorParams): Promise<void>;
22
+ /** Begins TOTP enrollment when status is "needs_mfa_enrollment". */
23
+ enrollTotp(): Promise<void>;
24
+ /** Confirms an authenticator code, activating TOTP and completing the flow. */
25
+ verifyTotpEnrollment(code: string): Promise<void>;
26
+ resend(): Promise<void>;
27
+ reset(): void;
28
+ }
29
+ /**
30
+ * useResetPassword wraps the headless ResetPasswordFlow in reactive Vue state,
31
+ * symmetric to useSignIn/useSignUp. The prebuilt <ResetPassword> component
32
+ * consumes this composable.
33
+ */
34
+ export declare function useResetPassword(): UseResetPassword;
@@ -0,0 +1,23 @@
1
+ import type { MeUser } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseSession {
4
+ /** Whether an end-user session is active. */
5
+ isSignedIn: Ref<boolean>;
6
+ /** True while the initial check is running. */
7
+ loading: Ref<boolean>;
8
+ /** The raw access token, if present (decode client-side; verify on backend). */
9
+ accessToken: Ref<string | null>;
10
+ /** The signed-in end-user's own profile (best-effort — see Providame.session()),
11
+ * or null if not signed in or the enrichment failed. Powers prebuilt
12
+ * components like <UserButton>. */
13
+ user: Ref<MeUser | null>;
14
+ /** Re-checks the session against the server. */
15
+ refresh(): Promise<void>;
16
+ /** Signs out and clears local state. */
17
+ signOut(): Promise<void>;
18
+ }
19
+ /**
20
+ * useSession exposes the current end-user session and hydrates it on mount. Use
21
+ * it to gate UI ("show dashboard vs. sign-in") in a fully custom app.
22
+ */
23
+ export declare function useSession(): UseSession;
@@ -0,0 +1,57 @@
1
+ import { ProvidameError, type EnrollTotpResponse, type FactorKind, type FirstFactorParams, type SecondFactorParams, type Session } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseSignIn {
4
+ /** Current flow status; "idle" before create(). */
5
+ status: Ref<string>;
6
+ /** True while a request is in flight. */
7
+ loading: Ref<boolean>;
8
+ /** Last error, or null. */
9
+ error: Ref<ProvidameError | null>;
10
+ /** First factors the backend will accept next. */
11
+ firstFactors: Ref<FactorKind[]>;
12
+ /** Second factors required, if any. */
13
+ secondFactors: Ref<FactorKind[]>;
14
+ /** The session, once complete. */
15
+ session: Ref<Session | null>;
16
+ /** True once authentication is complete. */
17
+ isComplete: Ref<boolean>;
18
+ /** Secret + otpauth URI for a pending mid-flow TOTP enrollment. */
19
+ enrollment: Ref<EnrollTotpResponse | null>;
20
+ /** One-time backup codes, populated right after a mid-flow TOTP enrollment. */
21
+ recoveryCodes: Ref<string[] | null>;
22
+ create(identifier: string): Promise<void>;
23
+ /** Combined identifier+password sign-in for a single-screen UI: calls
24
+ * create() then immediately attemptFirstFactor({strategy: "password"}) in
25
+ * one guarded call. On failure at either step, the flow resets back to
26
+ * idle so the same combined form can be resubmitted, rather than leaving
27
+ * status at "needs_first_factor" (a failed attemptFirstFactor's status)
28
+ * with no identifier field left to fix it from. */
29
+ signInWithPassword(identifier: string, password: string): Promise<void>;
30
+ /** Opens the flow with a passkey and immediately prompts the user via
31
+ * navigator.credentials.get() — one call, unlike create()+attemptFirstFactor(). */
32
+ signInWithPasskey(identifier: string, domain: string): Promise<void>;
33
+ /** Opens the flow by emailing a one-time code; call attemptFirstFactor({strategy: "otp_email", code}) once the end-user has it. */
34
+ signInWithOTPEmail(identifier: string): Promise<void>;
35
+ /** Re-sends the code for a flow opened via signInWithOTPEmail(). */
36
+ resendOTPEmail(): Promise<void>;
37
+ /** Opens the flow by texting a one-time code to the phone on file; call attemptFirstFactor({strategy: "otp_sms", code}) once the end-user has it. */
38
+ signInWithOTPSMS(identifier: string): Promise<void>;
39
+ /** Re-sends the code for a flow opened via signInWithOTPSMS(). */
40
+ resendOTPSMS(): Promise<void>;
41
+ /** Opens the flow by emailing a passwordless "click to sign in" link to returnUrl. */
42
+ signInWithMagicLink(identifier: string, returnUrl: string): Promise<void>;
43
+ attemptFirstFactor(params: FirstFactorParams): Promise<void>;
44
+ attemptSecondFactor(params: SecondFactorParams): Promise<void>;
45
+ /** Begins TOTP enrollment when status is "needs_mfa_enrollment". */
46
+ enrollTotp(): Promise<void>;
47
+ /** Confirms an authenticator code, activating TOTP and completing the flow. */
48
+ verifyTotpEnrollment(code: string): Promise<void>;
49
+ reset(): void;
50
+ }
51
+ /**
52
+ * useSignIn wraps the headless SignInFlow in reactive Vue state. This is the
53
+ * binding a developer uses to build a completely custom sign-in UI — they read
54
+ * `status`/`firstFactors`/`error` and render whatever they want. The prebuilt
55
+ * <SignIn> component consumes this very composable.
56
+ */
57
+ export declare function useSignIn(): UseSignIn;
@@ -0,0 +1,23 @@
1
+ import { ProvidameError, type EnabledIdp } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseSignInIdp {
4
+ /** Providers enabled for this environment, fetched on mount. Empty until
5
+ * loaded, and stays empty (silently) if that background fetch fails —
6
+ * providers are decorative, not something to block sign-in over. */
7
+ providers: Ref<EnabledIdp[]>;
8
+ /** True while a signIn() call's start request is in flight. Stays true on
9
+ * success — there is no in-page "done" state, the browser navigates away. */
10
+ loading: Ref<boolean>;
11
+ /** Populated by a failed signIn() start request, or by a post-redirect
12
+ * social-login-error event. */
13
+ error: Ref<ProvidameError | null>;
14
+ signIn(provider: string, returnUrl?: string): Promise<void>;
15
+ }
16
+ /**
17
+ * useSignInIdp wraps the redirect-based social-login flow: it fetches which
18
+ * providers are enabled for this environment, exposes a signIn() action, and
19
+ * surfaces a post-redirect failure (from returning after the external IdP
20
+ * round-trip) in the same `error` ref as a pre-redirect request failure. The
21
+ * prebuilt <SignIn> component consumes this composable directly.
22
+ */
23
+ export declare function useSignInIdp(): UseSignInIdp;
@@ -0,0 +1,30 @@
1
+ import { ProvidameError, type CreateSignUpParams, type EnrollTotpResponse, type FactorKind, type SecondFactorParams, type Session, type VerificationParams } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseSignUp {
4
+ status: Ref<string>;
5
+ loading: Ref<boolean>;
6
+ error: Ref<ProvidameError | null>;
7
+ secondFactors: Ref<FactorKind[]>;
8
+ session: Ref<Session | null>;
9
+ isComplete: Ref<boolean>;
10
+ needsVerification: Ref<boolean>;
11
+ /** True once a completed verification lands the account on a waitlist —
12
+ * see FlowStatus's own doc comment. No session is issued in this case. */
13
+ isWaitlisted: Ref<boolean>;
14
+ /** Secret + otpauth URI for a pending post-registration TOTP enrollment. */
15
+ enrollment: Ref<EnrollTotpResponse | null>;
16
+ /** One-time backup codes, populated right after a post-registration TOTP enrollment. */
17
+ recoveryCodes: Ref<string[] | null>;
18
+ create(params: CreateSignUpParams): Promise<void>;
19
+ attemptVerification(params: VerificationParams): Promise<void>;
20
+ attemptSecondFactor(params: SecondFactorParams): Promise<void>;
21
+ /** Begins TOTP enrollment when status is "needs_mfa_enrollment". */
22
+ enrollTotp(): Promise<void>;
23
+ /** Confirms an authenticator code, activating TOTP and completing the flow. */
24
+ verifyTotpEnrollment(code: string): Promise<void>;
25
+ reset(): void;
26
+ }
27
+ /**
28
+ * useSignUp is the reactive headless sign-up binding, symmetric to useSignIn.
29
+ */
30
+ export declare function useSignUp(): UseSignUp;
@@ -0,0 +1,10 @@
1
+ import type { MeUser } from "@providame/core";
2
+ import { type Ref } from "vue";
3
+ export interface UseUser {
4
+ isLoaded: Ref<boolean>;
5
+ isSignedIn: Ref<boolean>;
6
+ user: Ref<MeUser | null>;
7
+ reload(): Promise<void>;
8
+ }
9
+ /** Clerk-shaped current-user hook, thinner than useSession (no accessToken/signOut). */
10
+ export declare function useUser(): UseUser;