Use the Authorizer class from @niledatabase/client to manage authentication
@niledatabase/client
exposes the the client side functions for various authorization requests. It handles API requests for sign-in, sign-up, sessions, and password reset. The client is designed to work with @niledatabase/server
which provides the server-side routes.
Authorizer
, which can be accessed via auth
/auth/session
.
credentials
Name | Type | Description |
---|---|---|
callbackUrl | string | The URL to return when the request is complete. |
redirect | boolean | Allows configuration of client-side redirects in the case of credential login |
Authorizer
.
new Authorizer(config)
accepts the following options:
Name | Type | Description |
---|---|---|
baseUrl | string | The base URL of your application. |
basePath | string | Optional API path, defaults to /api . |
init | RequestInit | Default fetch options for all requests. |
state
object with baseUrl
, session
, and loading status. You can update the configuration later by calling auth.configure({ baseUrl })
.