@krak-stack/auth 0.1.63 → 0.1.64
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.
package/README.md
CHANGED
|
@@ -57,6 +57,8 @@ When components are configured, register their Tailwind source:
|
|
|
57
57
|
@import "@krak-stack/auth/tailwind.css";
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
`createAuthUiClient` sends credentials by default so hosted KrakStack Auth UI can resolve sessions when embedded in consumer apps on a different origin. Pass `{ credentials: "omit" }` only for intentionally anonymous or custom clients.
|
|
61
|
+
|
|
60
62
|
`UserButton` accepts `menuActions` for app-owned menu items such as dashboard or workspace links:
|
|
61
63
|
|
|
62
64
|
```tsx
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { apiKeyClient } from "@better-auth/api-key/client";
|
|
2
|
+
import type { BetterAuthClientOptions } from "@better-auth/core";
|
|
2
3
|
import { adminClient, anonymousClient, emailOTPClient, genericOAuthClient, inferAdditionalFields, lastLoginMethodClient, organizationClient, twoFactorClient } from "better-auth/client/plugins";
|
|
3
4
|
import { type ReactAuthClient } from "better-auth/react";
|
|
4
5
|
declare const additionalFields: {
|
|
@@ -37,10 +38,13 @@ type AuthUiClientPlugins = [
|
|
|
37
38
|
ReturnType<typeof apiKeyClient>,
|
|
38
39
|
ReturnType<typeof genericOAuthClient>
|
|
39
40
|
];
|
|
40
|
-
type AuthUiClientOptions = {
|
|
41
|
+
type AuthUiClientOptions = BetterAuthClientOptions & {
|
|
41
42
|
baseURL?: string | undefined;
|
|
42
43
|
plugins: AuthUiClientPlugins;
|
|
43
44
|
};
|
|
45
|
+
type CreateAuthUiClientOptions = {
|
|
46
|
+
credentials?: RequestCredentials | undefined;
|
|
47
|
+
};
|
|
44
48
|
export type AuthUiClient = ReactAuthClient<AuthUiClientOptions>;
|
|
45
|
-
export declare const createAuthUiClient: (baseUrl?: string | undefined) => ReactAuthClient<AuthUiClientOptions>;
|
|
49
|
+
export declare const createAuthUiClient: (baseUrl?: string | undefined, options?: CreateAuthUiClientOptions) => ReactAuthClient<AuthUiClientOptions>;
|
|
46
50
|
export {};
|
|
@@ -37,7 +37,10 @@ const authUiClientPlugins = [
|
|
|
37
37
|
apiKeyClient(),
|
|
38
38
|
genericOAuthClient(),
|
|
39
39
|
];
|
|
40
|
-
export const createAuthUiClient = (baseUrl) => createAuthClient({
|
|
40
|
+
export const createAuthUiClient = (baseUrl, options) => createAuthClient({
|
|
41
41
|
...(baseUrl ? { baseURL: baseUrl } : {}),
|
|
42
|
+
fetchOptions: {
|
|
43
|
+
credentials: options?.credentials ?? "include",
|
|
44
|
+
},
|
|
42
45
|
plugins: authUiClientPlugins,
|
|
43
46
|
});
|