NhostAuthConstructorParams
No description provided.
NhostAuthConstructorParams
Parameters
url required string
devTools optional boolean
Activate devTools e.g. the ability to connect to the xstate inspector
autoSignIn optional boolean
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
autoRefreshToken optional boolean
When set to true, will automatically refresh token before it expires
clientStorage optional ClientStorage
Object where the refresh token will be persisted and read locally.
Recommended values:
-
'web'
and'cookies'
: no value is required -
'react-native'
: use @react-native-async-storage/async-storage -
'custom'
: an object that defines the following methods:setItem
orsetItemAsync
getItem
orgetItemAsync
removeItem
-
'capacitor'
:- capacitor version < 4 : use @capacitor/storage
- capacitor version >= 4 : use @capacitor/preferences
-
'expo-secure-store'
: use expo-secure-store
Property | Type | Required | Notes |
---|---|---|---|
clientStorage.setItem | (_key: string, _value: string) => void | ||
clientStorage.getItem | (key: string) => any | ||
clientStorage.removeItem | (key: string) => void | ||
clientStorage.set | (options: { key: string, value: string }) => void | ||
clientStorage.get | (options: { key: string }) => any | ||
clientStorage.remove | (options: { key: string }) => void | ||
clientStorage.setItemAsync | (key: string, value: string) => void | ||
clientStorage.getItemAsync | (key: string) => any | ||
clientStorage.deleteItemAsync | (key: string) => void | ||
clientStorage.customGet | (key: string) => null | string | Promise<null | string> | ||
clientStorage.customSet | (key: string, value: null | string) => void | Promise<void> |
clientStorageType optional ClientStorageType
Define a way to get information about the refresh token and its exipration date.
@default
web
refreshIntervalTime optional number
Time interval until token refreshes, in seconds
start optional boolean