@daveyplate/better-auth-ui
Version:
Plug & play shadcn/ui components for better-auth
1,149 lines (1,145 loc) • 128 kB
TypeScript
import * as _better_auth_passkey from '@better-auth/passkey';
import { Passkey } from '@better-auth/passkey';
import * as _better_fetch_fetch from '@better-fetch/fetch';
import { BetterFetchError } from '@better-fetch/fetch';
import * as better_auth from 'better-auth';
import { Account, User } from 'better-auth';
import { Member } from 'better-auth/plugins/organization';
import * as better_auth_react from 'better-auth/react';
import { createAuthClient } from 'better-auth/react';
import * as better_auth_client_plugins from 'better-auth/client/plugins';
import * as _better_auth_passkey_client from '@better-auth/passkey/client';
import * as better_auth_plugins from 'better-auth/plugins';
type Refetch = () => Promise<unknown> | unknown;
type AnyAuthClient = Omit<ReturnType<typeof createAuthClient>, "signUp" | "getSession">;
type ApiKey = {
id: string;
name?: string | null;
start?: string | null;
expiresAt?: Date | null;
createdAt: Date;
updatedAt: Date;
metadata?: Record<string, unknown> | null;
};
declare const authClient: {
useListPasskeys: () => {
data: _better_auth_passkey.Passkey[] | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
refetch: (queryParams?: {
query?: better_auth.SessionQueryParams;
} | undefined) => Promise<void>;
};
} & {} & {
useActiveOrganization: () => {
data: better_auth.Prettify<{
id: string;
name: string;
slug: string;
createdAt: Date;
logo?: string | null | undefined | undefined;
metadata?: any;
} & {
members: {
id: string;
organizationId: string;
role: "member" | "admin" | "owner";
createdAt: Date;
userId: string;
teamId?: string | undefined | undefined;
user: {
id: string;
email: string;
name: string;
image?: string | undefined;
};
}[];
invitations: {
id: string;
organizationId: string;
email: string;
role: "member" | "admin" | "owner";
status: better_auth_plugins.InvitationStatus;
inviterId: string;
expiresAt: Date;
createdAt: Date;
teamId?: string | undefined | undefined;
}[];
}> | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
refetch: (queryParams?: {
query?: better_auth.SessionQueryParams;
} | undefined) => Promise<void>;
};
useListOrganizations: () => {
data: {
id: string;
name: string;
slug: string;
createdAt: Date;
logo?: string | null | undefined | undefined;
metadata?: any;
}[] | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
refetch: (queryParams?: {
query?: better_auth.SessionQueryParams;
} | undefined) => Promise<void>;
};
useActiveMember: () => {
data: {
id: string;
organizationId: string;
userId: string;
role: string;
createdAt: Date;
} | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
refetch: (queryParams?: {
query?: better_auth.SessionQueryParams;
} | undefined) => Promise<void>;
};
useActiveMemberRole: () => {
data: {
role: string;
} | null;
error: null | _better_fetch_fetch.BetterFetchError;
isPending: boolean;
isRefetching: boolean;
refetch: (queryParams?: {
query?: better_auth.SessionQueryParams;
} | undefined) => Promise<void>;
};
} & {
signIn: {
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
provider: "line" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
callbackURL?: string | undefined;
newUserCallbackURL?: string | undefined;
errorCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
idToken?: {
token: string;
nonce?: string | undefined;
accessToken?: string | undefined;
refreshToken?: string | undefined;
expiresAt?: number | undefined;
} | undefined;
scopes?: string[] | undefined;
requestSignUp?: boolean | undefined;
loginHint?: string | undefined;
additionalData?: Record<string, any> | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
provider: "line" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
callbackURL?: string | undefined;
newUserCallbackURL?: string | undefined;
errorCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
idToken?: {
token: string;
nonce?: string | undefined;
accessToken?: string | undefined;
refreshToken?: string | undefined;
expiresAt?: number | undefined;
} | undefined;
scopes?: string[] | undefined;
requestSignUp?: boolean | undefined;
loginHint?: string | undefined;
additionalData?: Record<string, any> | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
redirect: boolean;
url: string;
} | {
redirect: boolean;
token: string;
url: undefined;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined | undefined;
};
}>, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
success: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
signUp: {
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
name: string;
email: string;
password: string;
image?: string | undefined;
callbackURL?: string | undefined;
rememberMe?: boolean | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
email: string;
name: string;
password: string;
image?: string | undefined;
callbackURL?: string | undefined;
fetchOptions?: FetchOptions | undefined;
} & {} & {} & {} & {
username?: string | null | undefined;
displayUsername?: string | null | undefined;
} & {} & {}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
token: null;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined | undefined;
};
} | {
token: string;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined | undefined;
};
}>, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
signIn: {
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
email: string;
password: string;
callbackURL?: string | undefined;
rememberMe?: boolean | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
email: string;
password: string;
callbackURL?: string | undefined;
rememberMe?: boolean | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
redirect: boolean;
token: string;
url?: string | undefined;
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined | undefined;
};
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
newPassword: string;
token?: string | undefined;
}> & Record<string, any>, Partial<{
token?: string | undefined;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
newPassword: string;
token?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
token: string;
callbackURL?: string | undefined;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
query: {
token: string;
callbackURL?: string | undefined;
};
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
status: boolean;
}>, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
email: string;
callbackURL?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
email: string;
callbackURL?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
newEmail: string;
callbackURL?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
newEmail: string;
callbackURL?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
newPassword: string;
currentPassword: string;
revokeOtherSessions?: boolean | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
newPassword: string;
currentPassword: string;
revokeOtherSessions?: boolean | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
token: string | null;
user: {
id: string;
email: string;
name: string;
image: string | null | undefined;
emailVerified: boolean;
createdAt: Date;
updatedAt: Date;
};
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
name?: string | undefined;
image?: string | undefined | null;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
image?: (string | null) | undefined;
name?: string | undefined;
fetchOptions?: FetchOptions | undefined;
} & Partial<{} & {} & {} & {
username?: string | null | undefined;
displayUsername?: string | null | undefined;
} & {} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
callbackURL?: string | undefined;
password?: string | undefined;
token?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
callbackURL?: string | undefined;
password?: string | undefined;
token?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
success: boolean;
message: string;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
email: string;
redirectTo?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
email: string;
redirectTo?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
message: string;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
resetPassword: {
":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
callbackURL: string;
}> & Record<string, any>, {
token: string;
}>>(data_0: better_auth.Prettify<{
query: {
callbackURL: string;
};
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined | undefined;
userAgent?: string | null | undefined | undefined;
}>[], {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
token: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
token: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
provider: unknown;
callbackURL?: string | undefined;
idToken?: {
token: string;
nonce?: string | undefined;
accessToken?: string | undefined;
refreshToken?: string | undefined;
scopes?: string[] | undefined;
} | undefined;
requestSignUp?: boolean | undefined;
scopes?: string[] | undefined;
errorCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
additionalData?: Record<string, any> | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
provider: unknown;
callbackURL?: string | undefined;
idToken?: {
token: string;
nonce?: string | undefined;
accessToken?: string | undefined;
refreshToken?: string | undefined;
scopes?: string[] | undefined;
} | undefined;
requestSignUp?: boolean | undefined;
scopes?: string[] | undefined;
errorCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
additionalData?: Record<string, any> | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
url: string;
redirect: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
id: string;
providerId: string;
createdAt: Date;
updatedAt: Date;
accountId: string;
userId: string;
scopes: string[];
}[], {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
deleteUser: {
callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
token: string;
callbackURL?: string | undefined;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
query: {
token: string;
callbackURL?: string | undefined;
};
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
success: boolean;
message: string;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
providerId: string;
accountId?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
providerId: string;
accountId?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
providerId: string;
accountId?: string | undefined;
userId?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
providerId: string;
accountId?: string | undefined;
userId?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
accessToken: string | undefined;
refreshToken: string | undefined;
accessTokenExpiresAt: Date | undefined;
refreshTokenExpiresAt: Date | undefined;
scope: string | null | undefined;
idToken: string | null | undefined;
providerId: string;
accountId: string;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
providerId: string;
accountId?: string | undefined;
userId?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
providerId: string;
accountId?: string | undefined;
userId?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
accessToken: string;
accessTokenExpiresAt: Date | undefined;
scopes: string[];
idToken: string | undefined;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
accountId?: string | undefined;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: {
accountId?: string | undefined;
} | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
user: better_auth.OAuth2UserInfo;
data: Record<string, any>;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
disableCookieCache?: unknown;
disableRefresh?: unknown;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: {
disableCookieCache?: unknown;
disableRefresh?: unknown;
} | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
isAnonymous: boolean | null | undefined;
username?: string | null | undefined;
displayUsername?: string | null | undefined;
twoFactorEnabled: boolean | null | undefined;
};
session: {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
activeOrganizationId?: string | null | undefined;
activeTeamId?: string | null | undefined;
};
} | null, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
} & {
apiKey: {
create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
name?: string | undefined;
expiresIn?: number | null | undefined;
userId?: unknown;
prefix?: string | undefined;
remaining?: number | null | undefined;
metadata?: any;
refillAmount?: number | undefined;
refillInterval?: number | undefined;
rateLimitTimeWindow?: number | undefined;
rateLimitMax?: number | undefined;
rateLimitEnabled?: boolean | undefined;
permissions?: Record<string, string[]> | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
name?: string | undefined;
expiresIn?: number | null | undefined;
userId?: unknown;
prefix?: string | undefined;
remaining?: number | null | undefined;
metadata?: any;
refillAmount?: number | undefined;
refillInterval?: number | undefined;
rateLimitTimeWindow?: number | undefined;
rateLimitMax?: number | undefined;
rateLimitEnabled?: boolean | undefined;
permissions?: Record<string, string[]> | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
key: string;
metadata: any;
permissions: any;
id: string;
name: string | null;
start: string | null;
prefix: string | null;
userId: string;
refillInterval: number | null;
refillAmount: number | null;
lastRefillAt: Date | null;
enabled: boolean;
rateLimitEnabled: boolean;
rateLimitTimeWindow: number | null;
rateLimitMax: number | null;
requestCount: number;
remaining: number | null;
lastRequest: Date | null;
expiresAt: Date | null;
createdAt: Date;
updatedAt: Date;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
apiKey: {
get: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
id: string;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
query: {
id: string;
};
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
permissions: {
[key: string]: string[];
} | null;
id: string;
name: string | null;
start: string | null;
prefix: string | null;
userId: string;
refillInterval: number | null;
refillAmount: number | null;
lastRefillAt: Date | null;
enabled: boolean;
rateLimitEnabled: boolean;
rateLimitTimeWindow: number | null;
rateLimitMax: number | null;
requestCount: number;
remaining: number | null;
lastRequest: Date | null;
expiresAt: Date | null;
createdAt: Date;
updatedAt: Date;
metadata: Record<string, any> | null;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
apiKey: {
update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
keyId: string;
userId?: unknown;
name?: string | undefined;
enabled?: boolean | undefined;
remaining?: number | undefined;
refillAmount?: number | undefined;
refillInterval?: number | undefined;
metadata?: any;
expiresIn?: number | null | undefined;
rateLimitEnabled?: boolean | undefined;
rateLimitTimeWindow?: number | undefined;
rateLimitMax?: number | undefined;
permissions?: Record<string, string[]> | null | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
keyId: string;
userId?: unknown;
name?: string | undefined;
enabled?: boolean | undefined;
remaining?: number | undefined;
refillAmount?: number | undefined;
refillInterval?: number | undefined;
metadata?: any;
expiresIn?: number | null | undefined;
rateLimitEnabled?: boolean | undefined;
rateLimitTimeWindow?: number | undefined;
rateLimitMax?: number | undefined;
permissions?: Record<string, string[]> | null | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
permissions: {
[key: string]: string[];
} | null;
id: string;
name: string | null;
start: string | null;
prefix: string | null;
userId: string;
refillInterval: number | null;
refillAmount: number | null;
lastRefillAt: Date | null;
enabled: boolean;
rateLimitEnabled: boolean;
rateLimitTimeWindow: number | null;
rateLimitMax: number | null;
requestCount: number;
remaining: number | null;
lastRequest: Date | null;
expiresAt: Date | null;
createdAt: Date;
updatedAt: Date;
metadata: Record<string, any> | null;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
apiKey: {
delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
keyId: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
keyId: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
success: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
apiKey: {
list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
permissions: {
[key: string]: string[];
} | null;
id: string;
name: string | null;
start: string | null;
prefix: string | null;
userId: string;
refillInterval: number | null;
refillAmount: number | null;
lastRefillAt: Date | null;
enabled: boolean;
rateLimitEnabled: boolean;
rateLimitTimeWindow: number | null;
rateLimitMax: number | null;
requestCount: number;
remaining: number | null;
lastRequest: Date | null;
expiresAt: Date | null;
createdAt: Date;
updatedAt: Date;
metadata: Record<string, any> | null;
}[], {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
multiSession: {
listDeviceSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
user: {
id: string;
createdAt: Date;
updatedAt: Date;
email: string;
emailVerified: boolean;
name: string;
image?: string | null | undefined;
};
session: {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
}[], {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
multiSession: {
setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
sessionToken: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
sessionToken: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
session: better_auth.Session & Record<string, any>;
user: better_auth.User & Record<string, any>;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
multiSession: {
revoke: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
sessionToken: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
sessionToken: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
generateRegisterOptions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
authenticatorAttachment?: "platform" | "cross-platform" | undefined;
name?: string | undefined;
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: {
authenticatorAttachment?: "platform" | "cross-platform" | undefined;
name?: string | undefined;
} | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<_better_auth_passkey_client.PublicKeyCredentialCreationOptionsJSON, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
generateAuthenticateOptions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<_better_auth_passkey_client.PublicKeyCredentialRequestOptionsJSON, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
verifyRegistration: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
response: any;
name?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
response: any;
name?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<_better_auth_passkey.Passkey, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
verifyAuthentication: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
response: _better_auth_passkey_client.AuthenticationResponseJSON;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
response: _better_auth_passkey_client.AuthenticationResponseJSON;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
session: {
id: string;
createdAt: Date;
updatedAt: Date;
userId: string;
expiresAt: Date;
token: string;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
listUserPasskeys: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<_better_auth_passkey.Passkey[], {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
deletePasskey: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
id: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
id: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
status: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
passkey: {
updatePasskey: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
id: string;
name: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
id: string;
name: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
passkey: _better_auth_passkey.Passkey;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
signIn: {
oauth2: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
providerId: string;
callbackURL?: string | undefined;
errorCallbackURL?: string | undefined;
newUserCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
scopes?: string[] | undefined;
requestSignUp?: boolean | undefined;
additionalData?: Record<string, any> | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
providerId: string;
callbackURL?: string | undefined;
errorCallbackURL?: string | undefined;
newUserCallbackURL?: string | undefined;
disableRedirect?: boolean | undefined;
scopes?: string[] | undefined;
requestSignUp?: boolean | undefined;
additionalData?: Record<string, any> | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
url: string;
redirect: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
oauth2: {
link: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
providerId: string;
callbackURL: string;
scopes?: string[] | undefined;
errorCallbackURL?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
providerId: string;
callbackURL: string;
scopes?: string[] | undefined;
errorCallbackURL?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
url: string;
redirect: boolean;
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
signIn: {
anonymous: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
query?: Record<string, any> | undefined;
fetchOptions?: FetchOptions | undefined;
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
token: string;
user: {
id: string;
email: string;
emailVerified: boolean;
name: string;
createdAt: Date;
updatedAt: Date;
};
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
signIn: {
username: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
username: string;
password: string;
rememberMe?: boolean | undefined;
callbackURL?: string | undefined;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
username: string;
password: string;
rememberMe?: boolean | undefined;
callbackURL?: string | undefined;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
token: string;
user: {
id: string;
email: string;
emailVerified: boolean;
username: string;
displayUsername: string;
name: string;
image: string | null | undefined;
createdAt: Date;
updatedAt: Date;
};
}, {
code?: string | undefined;
message?: string | undefined;
}, FetchOptions["throw"] extends true ? true : false>>;
};
} & {
isUsernameAvailable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
username: string;
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
username: string;
} & {
fetchOptions?: FetchOptions | undefined;
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
available: boolean;
}, {
code?: