@niledatabase/react 4.0.0-alpha.1 → 4.0.0-alpha.11
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 +71 -111
- package/dist/index.d.mts +97 -59
- package/dist/index.d.ts +97 -59
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -1
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -1,143 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img width="1434" alt="Screen Shot 2024-09-18 at 9 20 04 AM" src="https://github.com/user-attachments/assets/20585883-5cdc-4f15-93d3-dc150e87bc11">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
---
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
# Nile's React SDK
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
In the root of your react application, add a Nile provider. This will add a [QueryClientProvider](https://tanstack.com/query/v4/docs/quick-start) and a [CssVarsProvider](https://mui.com/joy-ui/getting-started/usage/) to your application.
|
|
9
|
+
This package (`@niledatabase/react`) is part of [Nile's Javascript SDK](https://github.com/niledatabase/nile-js/tree/main).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
import { NileProvider } from '@niledatabase/react';
|
|
13
|
-
|
|
14
|
-
function App() {
|
|
15
|
-
return (
|
|
16
|
-
<NileProvider>
|
|
17
|
-
<div>Welcome to my great app</div>
|
|
18
|
-
</NileProvider>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
```
|
|
11
|
+
Nile's React package provides:
|
|
22
12
|
|
|
23
|
-
|
|
13
|
+
- 🎨 UI components for authentication, user management, and tenant management (customizable with Tailwind CSS)
|
|
14
|
+
- 🪝 React hooks for authentication, user management, and tenant management functionality
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
| -------- | -------- | ----------------------------------------------------------------- |
|
|
27
|
-
| tenantId | `string` | ID of the tenant associated. |
|
|
28
|
-
| appUrl | `string` | the FQDN for a service running a `@niledatabase/server`-like API. |
|
|
29
|
-
| apiUrl | `string` | the API URL of your database |
|
|
16
|
+
You can browse all the components and explore their properties in [Nile's documentation](https://www.thenile.dev/docs/auth/components/signin) or in [Storybook](https://storybook.thenile.dev).
|
|
30
17
|
|
|
31
|
-
|
|
18
|
+
The components and hooks are designed to work best and provide a secure user experience when used with the generated routes provided by [Nile's Server-Side SDK](https://www.npmjs.com/package/@niledatabase/server).
|
|
32
19
|
|
|
33
|
-
|
|
20
|
+
**Nile is a Postgres platform that decouples storage from compute, virtualizes tenants, and supports vertical and horizontal scaling globally to ship B2B applications fast while being safe with limitless scale.** All B2B applications are multi-tenant. A tenant/customer is primarily a company, an organization, or a workspace in your product that contains a group of users. A B2B application provides services to multiple tenants. Tenant is the basic building block of all B2B applications.
|
|
34
21
|
|
|
35
|
-
|
|
22
|
+
## Usage
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
24
|
+
### Installation
|
|
39
25
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
retry: false,
|
|
44
|
-
refetchOnWindowFocus: false,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|
|
26
|
+
```bash
|
|
27
|
+
npm install @niledatabase/react
|
|
28
|
+
```
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
30
|
+
### Signup / User Info page
|
|
31
|
+
|
|
32
|
+
This example uses several components to build a one-page signup / user profile example.
|
|
33
|
+
|
|
34
|
+
- `<SignedIn>` component renders for authenticated users while `<SignedOut>` renders for un-authenticated users.
|
|
35
|
+
- `<SignUpForm>` component shows a standard email/password signup.
|
|
36
|
+
- `<UserInfo />` component shows information about currently authenticated user - their image, email, name, etc.
|
|
37
|
+
- `<TenantSelector>` component shows the current tenant, allows to switch between tenants and to create new tenants.
|
|
38
|
+
- `<SignOutButton />` component expires the current session
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import {
|
|
42
|
+
SignOutButton,
|
|
43
|
+
SignUpForm,
|
|
44
|
+
SignedIn,
|
|
45
|
+
SignedOut,
|
|
46
|
+
TenantSelector,
|
|
47
|
+
UserInfo,
|
|
48
|
+
} from "@niledatabase/react";
|
|
49
|
+
import "@niledatabase/react/styles.css";
|
|
50
|
+
|
|
51
|
+
export default function SignUpPage() {
|
|
52
|
+
return (
|
|
53
|
+
<div className="flex flex-col items-center justify-center min-h-screen">
|
|
54
|
+
<SignedIn className="flex flex-col gap-4">
|
|
55
|
+
<UserInfo />
|
|
56
|
+
<TenantSelector className="py-6 mb-10" />
|
|
57
|
+
<SignOutButton />
|
|
58
|
+
</SignedIn>
|
|
59
|
+
<SignedOut>
|
|
60
|
+
<SignUpForm createTenant />
|
|
61
|
+
</SignedOut>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
61
64
|
}
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
###
|
|
67
|
+
### Social Login (SSO)
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
Nile-Auth supports multiple social providers. You configure and enable them in [Nile console](https://console.thenile.dev), and then simply drop-in the components. For example, for Discord authentication:
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
```tsx
|
|
72
|
+
import { DiscordSignInButton } from '@niledatabase/react';
|
|
69
73
|
|
|
70
|
-
```typescript
|
|
71
74
|
function App() {
|
|
72
75
|
return (
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
</
|
|
76
|
+
<div>
|
|
77
|
+
<DiscordSignInButton callbackUrl="/" />
|
|
78
|
+
</div>
|
|
76
79
|
);
|
|
77
80
|
}
|
|
78
81
|
```
|
|
79
82
|
|
|
80
|
-
###
|
|
81
|
-
|
|
82
|
-
A method exposing the configuration created in `<NileProvider />`. The methods on the instance can be found in [the client src readme](../../lib/nile/src/README.md), or found in the auto-complete of visual studio code.
|
|
83
|
+
### Customizing the components
|
|
83
84
|
|
|
84
|
-
|
|
85
|
+
Nile’s react package includes a CSS file that you can use to provide a nice default style to the components:
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
```ts
|
|
88
|
+
import "@niledatabase/react/styles.css";
|
|
89
|
+
```
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
import React, { useEffect } from 'react';
|
|
90
|
-
import { useNile, Queries } from '@niledatabase/react';
|
|
91
|
-
import { useQuery } from '@tanstack/react-query';
|
|
91
|
+
Nile Auth components use CSS variables for theming. This means that you can override the colors and other styles by setting the CSS variables. We support the same CSS variables that [Shadcn uses](https://ui.shadcn.com/docs/theming#list-of-variables). You can modify them in your `global.css` file.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
const nile = useNile();
|
|
95
|
-
const [users, setUsers] = useState();
|
|
96
|
-
const { data: users = [] } = useQuery(Queries.ListUsers, () => nile.users.listUsers());
|
|
97
|
-
// with multiple requests
|
|
98
|
-
// const [{ data: users = [] }, { data: invites = [] }] = useQueries([
|
|
99
|
-
// { queryKey: Queries.ListUsers, queryFn: () => nile.users.listUsers({}) },
|
|
100
|
-
// { queryKey: Queries.ListInvites, queryFn: () => nile.organizations.listInvites({}) },
|
|
101
|
-
// ]);
|
|
93
|
+
For "spot changes", you can use the `className` prop of a component to customize it individually:
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return <div id={user.id}>{`Email: ${user.email}`</div>;
|
|
106
|
-
})
|
|
107
|
-
);
|
|
108
|
-
}
|
|
95
|
+
```tsx
|
|
96
|
+
<SignOutButton className="bg-red-500" />
|
|
109
97
|
```
|
|
110
98
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
For theming and display, A combination of [mui joy](https://mui.com/joy-ui/getting-started/overview/) and [material ui](https://mui.com/material-ui/getting-started/overview/) is used. As joy approaches feature parity with material, it will be removed from this codebase. For now, there are helper functions in the theme to support both, with the theming function preferring mui joy settings and colors over material.
|
|
114
|
-
|
|
115
|
-
For details on theming, see their [theming documentation](https://mui.com/joy-ui/customization/approaches/). You can pass a custom `theme` object to the `NileProvider` and it will merge it with the combined material and joy themes in the `<NileProvider />`.
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import { NileProvider } from '@niledatabase/react';
|
|
119
|
-
import { extendTheme } from '@mui/joy/styles';
|
|
120
|
-
const customTheme = extendTheme({
|
|
121
|
-
colorSchemes: {
|
|
122
|
-
light: {
|
|
123
|
-
palette: {
|
|
124
|
-
primary: {
|
|
125
|
-
solidBg: '#0078D4',
|
|
126
|
-
solidHoverBg: '#106EBE',
|
|
127
|
-
solidActiveBg: '#005A9E',
|
|
128
|
-
solidDisabledBg: '#F3F2F1',
|
|
129
|
-
solidDisabledColor: '#A19F9D',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
});
|
|
99
|
+
## Learn more
|
|
135
100
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<div>Welcome to my great app</div>
|
|
140
|
-
</NileProvider>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
```
|
|
101
|
+
- You can learn more about Nile and the SDK in [https://thenile.dev/docs]
|
|
102
|
+
- You can find detailed code examples in [our main repo](https://github.com/niledatabase/niledatabase)
|
|
103
|
+
- Nile SDK interacts with APIs in Nile Auth service. You can learn more about it in the [repository](https://github.com/niledatabase/nile-auth) and the [docs](https://thenile.dev/docs/auth)
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ import { BuiltInProviderType, RedirectableProviderType } from 'next-auth/provide
|
|
|
13
13
|
type EmailSignInInfo = SignInOptions;
|
|
14
14
|
type SignInSuccess = (response: Response) => void;
|
|
15
15
|
type AllowedAny$3 = any;
|
|
16
|
-
type Props$
|
|
16
|
+
type Props$5 = {
|
|
17
17
|
redirect?: boolean;
|
|
18
18
|
onSuccess?: SignInSuccess;
|
|
19
19
|
onError?: (e: Error, info: EmailSignInInfo) => void;
|
|
@@ -24,7 +24,7 @@ type Props$4 = {
|
|
|
24
24
|
init?: RequestInit;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
declare function EmailSigningIn(props: Props$
|
|
27
|
+
declare function EmailSigningIn(props: Props$5): React__default.JSX.Element;
|
|
28
28
|
|
|
29
29
|
declare const buttonVariants: (props?: ({
|
|
30
30
|
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
@@ -41,6 +41,14 @@ type EmailError = void | {
|
|
|
41
41
|
status: number;
|
|
42
42
|
url: null | string;
|
|
43
43
|
};
|
|
44
|
+
type AllProps = ButtonProps & {
|
|
45
|
+
callbackUrl?: string;
|
|
46
|
+
redirect?: boolean;
|
|
47
|
+
email: string;
|
|
48
|
+
onSent?: () => void;
|
|
49
|
+
onFailure?: (error: EmailError) => void;
|
|
50
|
+
buttonText?: string;
|
|
51
|
+
};
|
|
44
52
|
/**
|
|
45
53
|
* This works when the email identity provider is configured in the admin dashboard.
|
|
46
54
|
* @param props callbackUrl: the url to send the user to from their email
|
|
@@ -50,16 +58,12 @@ type EmailError = void | {
|
|
|
50
58
|
* @param props onFailure: called if there was a reportable
|
|
51
59
|
* @returns a JSX.Element to render
|
|
52
60
|
*/
|
|
53
|
-
declare const EmailSignInButton:
|
|
54
|
-
callbackUrl
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onSent?: () => void;
|
|
58
|
-
onFailure?: (error: EmailError) => void;
|
|
59
|
-
buttonText?: string;
|
|
60
|
-
} & React__default.RefAttributes<HTMLButtonElement>>;
|
|
61
|
+
declare const EmailSignInButton: {
|
|
62
|
+
({ callbackUrl, className, variant, size, asChild, redirect, buttonText, email, onFailure, onSent, ...props }: AllProps): React__default.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
61
65
|
|
|
62
|
-
declare function useEmailSignIn(params?: Props$
|
|
66
|
+
declare function useEmailSignIn(params?: Props$5): _tanstack_react_query.UseMutateFunction<Response, Error, next_auth_react.SignInOptions, unknown>;
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* A component for a Google login button, according to their design language.
|
|
@@ -67,53 +71,77 @@ declare function useEmailSignIn(params?: Props$4): _tanstack_react_query.UseMuta
|
|
|
67
71
|
* @param props callbackUrl: a string to override the URL provided by the context
|
|
68
72
|
* @returns a JSX.Element to render
|
|
69
73
|
*/
|
|
70
|
-
declare const GoogleSSOButton:
|
|
71
|
-
callbackUrl
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
declare const GoogleSSOButton: {
|
|
75
|
+
({ callbackUrl, className, variant, size, buttonText, asChild, init, ...props }: ButtonProps & {
|
|
76
|
+
callbackUrl?: string;
|
|
77
|
+
buttonText?: string;
|
|
78
|
+
init?: RequestInit;
|
|
79
|
+
}): React__default.JSX.Element;
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
75
82
|
|
|
76
|
-
declare const AzureSignInButton:
|
|
77
|
-
callbackUrl
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
declare const AzureSignInButton: {
|
|
84
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
85
|
+
callbackUrl?: string;
|
|
86
|
+
buttonText?: string;
|
|
87
|
+
init?: RequestInit;
|
|
88
|
+
}): React__default.JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
81
91
|
|
|
82
|
-
declare const DiscordSignInButton:
|
|
83
|
-
callbackUrl
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
declare const DiscordSignInButton: {
|
|
93
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
94
|
+
callbackUrl?: string;
|
|
95
|
+
buttonText?: string;
|
|
96
|
+
init?: RequestInit;
|
|
97
|
+
}): React__default.JSX.Element;
|
|
98
|
+
displayName: string;
|
|
99
|
+
};
|
|
87
100
|
|
|
88
|
-
declare const GitHubSignInButton:
|
|
89
|
-
callbackUrl
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
declare const GitHubSignInButton: {
|
|
102
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
103
|
+
callbackUrl?: string;
|
|
104
|
+
buttonText?: string;
|
|
105
|
+
init?: RequestInit;
|
|
106
|
+
}): React__default.JSX.Element;
|
|
107
|
+
displayName: string;
|
|
108
|
+
};
|
|
93
109
|
|
|
94
|
-
declare const HubSpotSignInButton:
|
|
95
|
-
callbackUrl
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
110
|
+
declare const HubSpotSignInButton: {
|
|
111
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
112
|
+
callbackUrl?: string;
|
|
113
|
+
buttonText?: string;
|
|
114
|
+
init?: RequestInit;
|
|
115
|
+
}): React__default.JSX.Element;
|
|
116
|
+
displayName: string;
|
|
117
|
+
};
|
|
99
118
|
|
|
100
|
-
declare const LinkedInSignInButton:
|
|
101
|
-
callbackUrl
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
119
|
+
declare const LinkedInSignInButton: {
|
|
120
|
+
({ callbackUrl, className, buttonText, variant, size, asChild, init, ...props }: ButtonProps & {
|
|
121
|
+
callbackUrl?: string;
|
|
122
|
+
buttonText?: string;
|
|
123
|
+
init?: RequestInit;
|
|
124
|
+
}): React__default.JSX.Element;
|
|
125
|
+
displayName: string;
|
|
126
|
+
};
|
|
105
127
|
|
|
106
|
-
declare const SlackSignInButton:
|
|
107
|
-
callbackUrl
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
declare const SlackSignInButton: {
|
|
129
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
130
|
+
callbackUrl?: string;
|
|
131
|
+
buttonText?: string;
|
|
132
|
+
init?: RequestInit;
|
|
133
|
+
}): React__default.JSX.Element;
|
|
134
|
+
displayName: string;
|
|
135
|
+
};
|
|
111
136
|
|
|
112
|
-
declare const XSignInButton:
|
|
113
|
-
callbackUrl
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
137
|
+
declare const XSignInButton: {
|
|
138
|
+
({ callbackUrl, className, buttonText, variant, size, init, asChild, ...props }: ButtonProps & {
|
|
139
|
+
callbackUrl?: string;
|
|
140
|
+
buttonText?: string;
|
|
141
|
+
init?: RequestInit;
|
|
142
|
+
}): React__default.JSX.Element;
|
|
143
|
+
displayName: string;
|
|
144
|
+
};
|
|
117
145
|
|
|
118
146
|
type JWT = {
|
|
119
147
|
email: string;
|
|
@@ -165,6 +193,7 @@ type Config = {
|
|
|
165
193
|
type PartialAuthorizer = null | {
|
|
166
194
|
state?: {
|
|
167
195
|
baseUrl?: string;
|
|
196
|
+
basePath?: string;
|
|
168
197
|
session?: {
|
|
169
198
|
user?: {
|
|
170
199
|
email?: string | undefined;
|
|
@@ -221,6 +250,7 @@ declare class Authorizer {
|
|
|
221
250
|
initialize(params?: {
|
|
222
251
|
baseUrl?: string;
|
|
223
252
|
session?: NonErrorSession | null | undefined;
|
|
253
|
+
event?: 'storage' | 'timer' | 'hidden' | 'poll' | 'visibilitychange';
|
|
224
254
|
}): Promise<void>;
|
|
225
255
|
get apiBaseUrl(): string;
|
|
226
256
|
fetchData<T = any>(url: string, init?: RequestInit): Promise<T | undefined>;
|
|
@@ -240,6 +270,7 @@ declare class Authorizer {
|
|
|
240
270
|
baseUrl?: string;
|
|
241
271
|
auth?: Authorizer | PartialAuthorizer;
|
|
242
272
|
fetchUrl?: string;
|
|
273
|
+
basePath?: string;
|
|
243
274
|
}): Promise<R extends true ? undefined : SignOutResponse>;
|
|
244
275
|
signIn<P extends RedirectableProviderType | undefined = undefined>(provider?: LiteralUnion<P extends RedirectableProviderType ? P | BuiltInProviderType : BuiltInProviderType>, options?: SignInOptions & {
|
|
245
276
|
baseUrl?: string;
|
|
@@ -288,7 +319,7 @@ type SignUpInfo = CreateBasicUserRequest & {
|
|
|
288
319
|
newTenantName?: string;
|
|
289
320
|
};
|
|
290
321
|
type AllowedAny$2 = any;
|
|
291
|
-
type Props$
|
|
322
|
+
type Props$4 = PrefetchParams & {
|
|
292
323
|
onSuccess?: (response: Response, formValues: SignUpInfo) => void;
|
|
293
324
|
onError?: (e: Error, info: SignUpInfo) => void;
|
|
294
325
|
beforeMutate?: (data: AllowedAny$2) => AllowedAny$2;
|
|
@@ -299,9 +330,9 @@ type Props$3 = PrefetchParams & {
|
|
|
299
330
|
redirect?: boolean;
|
|
300
331
|
};
|
|
301
332
|
|
|
302
|
-
declare function SigningUp({ className, ...props }: Props$
|
|
333
|
+
declare function SigningUp({ className, ...props }: Props$4): React__default.JSX.Element;
|
|
303
334
|
|
|
304
|
-
declare function useSignUp<T extends SignUpInfo>(params: Props$
|
|
335
|
+
declare function useSignUp<T extends SignUpInfo>(params: Props$4, client?: QueryClient): _tanstack_react_query.UseMutateFunction<any, Error, SignUpInfo, unknown>;
|
|
305
336
|
|
|
306
337
|
type AllowedAny$1 = any;
|
|
307
338
|
type LoginInfo = {
|
|
@@ -309,7 +340,7 @@ type LoginInfo = {
|
|
|
309
340
|
password: string;
|
|
310
341
|
};
|
|
311
342
|
type LoginSuccess = (response: AllowedAny$1, formValues: LoginInfo, ...args: AllowedAny$1) => void;
|
|
312
|
-
type Props$
|
|
343
|
+
type Props$3 = ComponentFetchProps & {
|
|
313
344
|
beforeMutate?: (data: AllowedAny$1) => AllowedAny$1;
|
|
314
345
|
onSuccess?: LoginSuccess;
|
|
315
346
|
onError?: (error: Error, data: AllowedAny$1) => void;
|
|
@@ -320,16 +351,22 @@ type Props$2 = ComponentFetchProps & {
|
|
|
320
351
|
fetchUrl?: string;
|
|
321
352
|
};
|
|
322
353
|
|
|
323
|
-
declare function SigningIn({ className, ...props }: Props$
|
|
354
|
+
declare function SigningIn({ className, ...props }: Props$3): React__default.JSX.Element;
|
|
324
355
|
|
|
325
|
-
declare function useSignIn(params?: Props$
|
|
356
|
+
declare function useSignIn(params?: Props$3): _tanstack_react_query.UseMutateFunction<next_auth_react.SignInResponse | undefined, Error, LoginInfo, any>;
|
|
326
357
|
|
|
327
|
-
|
|
358
|
+
type Props$2 = ButtonProps & ComponentFetchProps & {
|
|
328
359
|
redirect?: boolean;
|
|
329
360
|
callbackUrl?: string;
|
|
330
361
|
buttonText?: string;
|
|
331
362
|
baseUrl?: string;
|
|
332
|
-
|
|
363
|
+
fetchUrl?: string;
|
|
364
|
+
basePath?: string;
|
|
365
|
+
};
|
|
366
|
+
declare const SignOutButton: {
|
|
367
|
+
({ callbackUrl, redirect, className, buttonText, variant, size, baseUrl, fetchUrl, basePath, auth, asChild, ...props }: Props$2): React__default.JSX.Element;
|
|
368
|
+
displayName: string;
|
|
369
|
+
};
|
|
333
370
|
|
|
334
371
|
interface SessionProviderProps {
|
|
335
372
|
children: React__default.ReactNode;
|
|
@@ -472,6 +509,7 @@ type Params = PrefetchParams & {
|
|
|
472
509
|
onSuccess?: (res: Response) => void;
|
|
473
510
|
onError?: (error: Error, data: AllowedAny) => void;
|
|
474
511
|
callbackUrl?: string;
|
|
512
|
+
basePath?: string;
|
|
475
513
|
};
|
|
476
514
|
type MutateFnParams = {
|
|
477
515
|
email?: string;
|