@better-auth-ui/core 1.6.6 → 1.6.8

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.
@@ -31,6 +31,8 @@ export declare const authQueryKeys: {
31
31
  readonly listDeviceSessions: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listDeviceSessions", NonNullable<TQuery> | null];
32
32
  /** Key for the user's passkey list. */
33
33
  readonly listPasskeys: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listPasskeys", NonNullable<TQuery> | null];
34
+ /** Key for the user's API keys list (`apiKey.list`). */
35
+ readonly listApiKeys: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listApiKeys", NonNullable<TQuery> | null];
34
36
  /** Key for `accountInfo` for the given user. */
35
37
  readonly accountInfo: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "accountInfo", NonNullable<TQuery> | null];
36
38
  /** Key for `listAccounts` for the given user. */
@@ -14,6 +14,11 @@ var e = {
14
14
  "listPasskeys",
15
15
  n ?? null
16
16
  ],
17
+ listApiKeys: (t, n) => [
18
+ ...e.user(t),
19
+ "listApiKeys",
20
+ n ?? null
21
+ ],
17
22
  accountInfo: (t, n) => [
18
23
  ...e.user(t),
19
24
  "accountInfo",
@@ -0,0 +1,25 @@
1
+ export declare const apiKeyLocalization: {
2
+ /** @remarks `"API key"` */
3
+ apiKey: string;
4
+ /** @remarks `"API keys"` */
5
+ apiKeys: string;
6
+ /** @remarks `"Create an API key for programmatic access to your account."` */
7
+ apiKeysDescription: string;
8
+ /** @remarks `"Create API key"` */
9
+ createApiKey: string;
10
+ /** @remarks `"No API keys"` */
11
+ noApiKeys: string;
12
+ /** @remarks `"Name"` */
13
+ name: string;
14
+ /** @remarks `"New API key"` */
15
+ newApiKey: string;
16
+ /** @remarks `"Copy this key now. For security reasons you will not be able to see it again."` */
17
+ newApiKeyWarning: string;
18
+ /** @remarks `"Delete API key"` */
19
+ deleteApiKey: string;
20
+ /** @remarks `"This action cannot be undone. Any service using this API key will stop working immediately."` */
21
+ deleteApiKeyWarning: string;
22
+ /** @remarks `"I've saved my key"` */
23
+ dismissNewKey: string;
24
+ };
25
+ export type ApiKeyLocalization = typeof apiKeyLocalization;
@@ -0,0 +1,16 @@
1
+ //#region src/plugins/api-key/api-key-localization.ts
2
+ var e = {
3
+ apiKey: "API key",
4
+ apiKeys: "API keys",
5
+ apiKeysDescription: "Create an API key for programmatic access to your account.",
6
+ createApiKey: "Create API key",
7
+ noApiKeys: "No API keys",
8
+ name: "Name",
9
+ newApiKey: "New API key",
10
+ newApiKeyWarning: "This is the only time you'll see this API key. Copy and store it somewhere safe.",
11
+ deleteApiKey: "Delete API key",
12
+ deleteApiKeyWarning: "This action cannot be undone. Any service using this API key will stop working immediately.",
13
+ dismissNewKey: "I've saved my key"
14
+ };
15
+ //#endregion
16
+ export { e as apiKeyLocalization };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Mutation keys contributed by the API key plugin.
3
+ */
4
+ export declare const apiKeyMutationKeys: {
5
+ /** Key for `apiKey.create`. */
6
+ readonly createApiKey: readonly ["auth", "apiKey", "create"];
7
+ /** Key for `apiKey.delete`. */
8
+ readonly deleteApiKey: readonly ["auth", "apiKey", "delete"];
9
+ };
@@ -0,0 +1,15 @@
1
+ //#region src/plugins/api-key/api-key-mutation-keys.ts
2
+ var e = {
3
+ createApiKey: [
4
+ "auth",
5
+ "apiKey",
6
+ "create"
7
+ ],
8
+ deleteApiKey: [
9
+ "auth",
10
+ "apiKey",
11
+ "delete"
12
+ ]
13
+ };
14
+ //#endregion
15
+ export { e as apiKeyMutationKeys };
@@ -0,0 +1,27 @@
1
+ import { ApiKeyLocalization } from './api-key-localization';
2
+ export type ApiKeyPluginOptions = {
3
+ /**
4
+ * Override the plugin's default localization strings.
5
+ * @remarks `ApiKeyLocalization`
6
+ */
7
+ localization?: Partial<ApiKeyLocalization>;
8
+ };
9
+ export declare const apiKeyPlugin: ((options?: ApiKeyPluginOptions | undefined) => Omit<{
10
+ localization: {
11
+ apiKey: string;
12
+ apiKeys: string;
13
+ apiKeysDescription: string;
14
+ createApiKey: string;
15
+ noApiKeys: string;
16
+ name: string;
17
+ newApiKey: string;
18
+ newApiKeyWarning: string;
19
+ deleteApiKey: string;
20
+ deleteApiKeyWarning: string;
21
+ dismissNewKey: string;
22
+ };
23
+ }, "id"> & {
24
+ id: "apiKey";
25
+ }) & {
26
+ id: "apiKey";
27
+ };
@@ -0,0 +1,9 @@
1
+ import { createAuthPlugin as e } from "../../lib/create-auth-plugin.js";
2
+ import { apiKeyLocalization as t } from "./api-key-localization.js";
3
+ //#region src/plugins/api-key/api-key-plugin.ts
4
+ var n = e("apiKey", (e = {}) => ({ localization: {
5
+ ...t,
6
+ ...e.localization
7
+ } }));
8
+ //#endregion
9
+ export { n as apiKeyPlugin };
@@ -1,3 +1,6 @@
1
+ export * from './api-key/api-key-localization';
2
+ export * from './api-key/api-key-mutation-keys';
3
+ export * from './api-key/api-key-plugin';
1
4
  export * from './delete-user/delete-user-localization';
2
5
  export * from './delete-user/delete-user-plugin';
3
6
  export * from './magic-link/magic-link-localization';
@@ -5,11 +5,17 @@ export declare const passkeyLocalization: {
5
5
  addPasskey: string;
6
6
  /** @remarks `"Delete passkey {{name}}"` */
7
7
  deletePasskey: string;
8
+ /** @remarks `"Delete passkey"` */
9
+ deletePasskeyTitle: string;
10
+ /** @remarks `"This action cannot be undone. You will need to add this passkey again before you can use it to sign in."` */
11
+ deletePasskeyWarning: string;
8
12
  /** @remarks `"Passkeys"` */
9
13
  passkeys: string;
10
- /** @remarks `"Manage your passkeys for secure access."` */
14
+ /** @remarks `"Create a passkey to securely access your account."` */
11
15
  passkeysDescription: string;
12
- /** @remarks `"Securely access your account without a password."` */
13
- passkeysInstructions: string;
16
+ /** @remarks `"No passkeys"` */
17
+ noPasskeys: string;
18
+ /** @remarks `"Name"` */
19
+ name: string;
14
20
  };
15
21
  export type PasskeyLocalization = typeof passkeyLocalization;
@@ -3,9 +3,12 @@ var e = {
3
3
  passkey: "Passkey",
4
4
  addPasskey: "Add passkey",
5
5
  deletePasskey: "Delete passkey {{name}}",
6
+ deletePasskeyTitle: "Delete passkey",
7
+ deletePasskeyWarning: "This action cannot be undone. You will need to add this passkey again before you can use it to sign in.",
6
8
  passkeys: "Passkeys",
7
- passkeysDescription: "Manage your passkeys for secure access.",
8
- passkeysInstructions: "Securely access your account without a password."
9
+ passkeysDescription: "Create a passkey to securely access your account.",
10
+ noPasskeys: "No passkeys",
11
+ name: "Name"
9
12
  };
10
13
  //#endregion
11
14
  export { e as passkeyLocalization };
@@ -11,9 +11,12 @@ export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined
11
11
  passkey: string;
12
12
  addPasskey: string;
13
13
  deletePasskey: string;
14
+ deletePasskeyTitle: string;
15
+ deletePasskeyWarning: string;
14
16
  passkeys: string;
15
17
  passkeysDescription: string;
16
- passkeysInstructions: string;
18
+ noPasskeys: string;
19
+ name: string;
17
20
  };
18
21
  }, "id"> & {
19
22
  id: "passkey";
package/dist/plugins.js CHANGED
@@ -1,15 +1,18 @@
1
- import { deleteUserLocalization as e } from "./plugins/delete-user/delete-user-localization.js";
2
- import { deleteUserPlugin as t } from "./plugins/delete-user/delete-user-plugin.js";
3
- import { magicLinkLocalization as n } from "./plugins/magic-link/magic-link-localization.js";
4
- import { magicLinkMutationKeys as r } from "./plugins/magic-link/magic-link-mutation-keys.js";
5
- import { magicLinkPlugin as i } from "./plugins/magic-link/magic-link-plugin.js";
6
- import { multiSessionLocalization as a } from "./plugins/multi-session/multi-session-localization.js";
7
- import { multiSessionPlugin as o } from "./plugins/multi-session/multi-session-plugin.js";
8
- import { passkeyLocalization as s } from "./plugins/passkey/passkey-localization.js";
9
- import { passkeyMutationKeys as c } from "./plugins/passkey/passkey-mutation-keys.js";
10
- import { passkeyPlugin as l } from "./plugins/passkey/passkey-plugin.js";
11
- import { themeLocalization as u } from "./plugins/theme/theme-localization.js";
12
- import { themePlugin as d } from "./plugins/theme/theme-plugin.js";
13
- import { usernameLocalization as f } from "./plugins/username/username-localization.js";
14
- import { usernamePlugin as p } from "./plugins/username/username-plugin.js";
15
- export { e as deleteUserLocalization, t as deleteUserPlugin, n as magicLinkLocalization, r as magicLinkMutationKeys, i as magicLinkPlugin, a as multiSessionLocalization, o as multiSessionPlugin, s as passkeyLocalization, c as passkeyMutationKeys, l as passkeyPlugin, u as themeLocalization, d as themePlugin, f as usernameLocalization, p as usernamePlugin };
1
+ import { apiKeyLocalization as e } from "./plugins/api-key/api-key-localization.js";
2
+ import { apiKeyMutationKeys as t } from "./plugins/api-key/api-key-mutation-keys.js";
3
+ import { apiKeyPlugin as n } from "./plugins/api-key/api-key-plugin.js";
4
+ import { deleteUserLocalization as r } from "./plugins/delete-user/delete-user-localization.js";
5
+ import { deleteUserPlugin as i } from "./plugins/delete-user/delete-user-plugin.js";
6
+ import { magicLinkLocalization as a } from "./plugins/magic-link/magic-link-localization.js";
7
+ import { magicLinkMutationKeys as o } from "./plugins/magic-link/magic-link-mutation-keys.js";
8
+ import { magicLinkPlugin as s } from "./plugins/magic-link/magic-link-plugin.js";
9
+ import { multiSessionLocalization as c } from "./plugins/multi-session/multi-session-localization.js";
10
+ import { multiSessionPlugin as l } from "./plugins/multi-session/multi-session-plugin.js";
11
+ import { passkeyLocalization as u } from "./plugins/passkey/passkey-localization.js";
12
+ import { passkeyMutationKeys as d } from "./plugins/passkey/passkey-mutation-keys.js";
13
+ import { passkeyPlugin as f } from "./plugins/passkey/passkey-plugin.js";
14
+ import { themeLocalization as p } from "./plugins/theme/theme-localization.js";
15
+ import { themePlugin as m } from "./plugins/theme/theme-plugin.js";
16
+ import { usernameLocalization as h } from "./plugins/username/username-localization.js";
17
+ import { usernamePlugin as g } from "./plugins/username/username-plugin.js";
18
+ export { e as apiKeyLocalization, t as apiKeyMutationKeys, n as apiKeyPlugin, r as deleteUserLocalization, i as deleteUserPlugin, a as magicLinkLocalization, o as magicLinkMutationKeys, s as magicLinkPlugin, c as multiSessionLocalization, l as multiSessionPlugin, u as passkeyLocalization, d as passkeyMutationKeys, f as passkeyPlugin, p as themeLocalization, m as themePlugin, h as usernameLocalization, g as usernamePlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth-ui/core",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",
@@ -24,11 +24,11 @@
24
24
  }
25
25
  },
26
26
  "devDependencies": {
27
- "better-auth": "^1.6.9",
27
+ "better-auth": "^1.6.10",
28
28
  "vitest": "^4.1.5"
29
29
  },
30
30
  "peerDependencies": {
31
- "better-auth": ">=1.6.9"
31
+ "better-auth": ">=1.6.10"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -48,6 +48,12 @@ export const authQueryKeys = {
48
48
  query?: TQuery
49
49
  ) => [...authQueryKeys.user(userId), "listPasskeys", query ?? null] as const,
50
50
 
51
+ /** Key for the user's API keys list (`apiKey.list`). */
52
+ listApiKeys: <TQuery = undefined>(
53
+ userId: string | undefined,
54
+ query?: TQuery
55
+ ) => [...authQueryKeys.user(userId), "listApiKeys", query ?? null] as const,
56
+
51
57
  /** Key for `accountInfo` for the given user. */
52
58
  accountInfo: <TQuery = undefined>(
53
59
  userId: string | undefined,
@@ -0,0 +1,29 @@
1
+ export const apiKeyLocalization = {
2
+ /** @remarks `"API key"` */
3
+ apiKey: "API key",
4
+ /** @remarks `"API keys"` */
5
+ apiKeys: "API keys",
6
+ /** @remarks `"Create an API key for programmatic access to your account."` */
7
+ apiKeysDescription:
8
+ "Create an API key for programmatic access to your account.",
9
+ /** @remarks `"Create API key"` */
10
+ createApiKey: "Create API key",
11
+ /** @remarks `"No API keys"` */
12
+ noApiKeys: "No API keys",
13
+ /** @remarks `"Name"` */
14
+ name: "Name",
15
+ /** @remarks `"New API key"` */
16
+ newApiKey: "New API key",
17
+ /** @remarks `"Copy this key now. For security reasons you will not be able to see it again."` */
18
+ newApiKeyWarning:
19
+ "This is the only time you'll see this API key. Copy and store it somewhere safe.",
20
+ /** @remarks `"Delete API key"` */
21
+ deleteApiKey: "Delete API key",
22
+ /** @remarks `"This action cannot be undone. Any service using this API key will stop working immediately."` */
23
+ deleteApiKeyWarning:
24
+ "This action cannot be undone. Any service using this API key will stop working immediately.",
25
+ /** @remarks `"I've saved my key"` */
26
+ dismissNewKey: "I've saved my key"
27
+ }
28
+
29
+ export type ApiKeyLocalization = typeof apiKeyLocalization
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Mutation keys contributed by the API key plugin.
3
+ */
4
+ export const apiKeyMutationKeys = {
5
+ /** Key for `apiKey.create`. */
6
+ createApiKey: ["auth", "apiKey", "create"] as const,
7
+ /** Key for `apiKey.delete`. */
8
+ deleteApiKey: ["auth", "apiKey", "delete"] as const
9
+ } as const
@@ -0,0 +1,20 @@
1
+ import { createAuthPlugin } from "../../lib/create-auth-plugin"
2
+ import {
3
+ type ApiKeyLocalization,
4
+ apiKeyLocalization
5
+ } from "./api-key-localization"
6
+
7
+ export type ApiKeyPluginOptions = {
8
+ /**
9
+ * Override the plugin's default localization strings.
10
+ * @remarks `ApiKeyLocalization`
11
+ */
12
+ localization?: Partial<ApiKeyLocalization>
13
+ }
14
+
15
+ export const apiKeyPlugin = createAuthPlugin(
16
+ "apiKey",
17
+ (options: ApiKeyPluginOptions = {}) => ({
18
+ localization: { ...apiKeyLocalization, ...options.localization }
19
+ })
20
+ )
@@ -1,3 +1,6 @@
1
+ export * from "./api-key/api-key-localization"
2
+ export * from "./api-key/api-key-mutation-keys"
3
+ export * from "./api-key/api-key-plugin"
1
4
  export * from "./delete-user/delete-user-localization"
2
5
  export * from "./delete-user/delete-user-plugin"
3
6
  export * from "./magic-link/magic-link-localization"
@@ -5,12 +5,19 @@ export const passkeyLocalization = {
5
5
  addPasskey: "Add passkey",
6
6
  /** @remarks `"Delete passkey {{name}}"` */
7
7
  deletePasskey: "Delete passkey {{name}}",
8
+ /** @remarks `"Delete passkey"` */
9
+ deletePasskeyTitle: "Delete passkey",
10
+ /** @remarks `"This action cannot be undone. You will need to add this passkey again before you can use it to sign in."` */
11
+ deletePasskeyWarning:
12
+ "This action cannot be undone. You will need to add this passkey again before you can use it to sign in.",
8
13
  /** @remarks `"Passkeys"` */
9
14
  passkeys: "Passkeys",
10
- /** @remarks `"Manage your passkeys for secure access."` */
11
- passkeysDescription: "Manage your passkeys for secure access.",
12
- /** @remarks `"Securely access your account without a password."` */
13
- passkeysInstructions: "Securely access your account without a password."
15
+ /** @remarks `"Create a passkey to securely access your account."` */
16
+ passkeysDescription: "Create a passkey to securely access your account.",
17
+ /** @remarks `"No passkeys"` */
18
+ noPasskeys: "No passkeys",
19
+ /** @remarks `"Name"` */
20
+ name: "Name"
14
21
  }
15
22
 
16
23
  export type PasskeyLocalization = typeof passkeyLocalization