Skip to main content

NhostClient

Nhost Client

const nhost = new NhostClient({ subdomain, region })

Parameters


__namedParameters required NhostClientConstructorParams

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