Skip to main content

createClient()

Parameters


config required NhostClientConstructorParams

PropertyTypeRequiredNotes
config.refreshIntervalTimenumberTime interval until token refreshes, in seconds
config.clientStorageTypeClientStorageTypeDefine a way to get information about the refresh token and its exipration date.
config.clientStorageClientStorageObject where the refresh token will be persisted and read locally.
config.autoRefreshTokenbooleanWhen set to true, will automatically refresh token before it expires
config.autoSignInbooleanWhen set to true, will parse the url on startup to check if it contains a refresh token to start the session with
config.devToolsbooleanActivate devTools e.g. the ability to connect to the xstate inspector
config.startboolean
config.backendUrlstringNhost backend URL Should only be used when self-hosting
config.adminSecretstringWhen set, the admin secret is sent as a header, x-hasura-admin-secret, for all requests to GraphQL, Storage, and Serverless Functions.
config.subdomainstringProject subdomain (e.g. ieingiwnginwnfnegqwvdqwdwq) Use localhost during local development
config.regionstringProject region (e.g. eu-central-1) Project region is not required during local development (when subdomain is localhost)