nhost_sdk library

Classes

ApiClient
Provides HTTP API methods, with response deserialization.
AuthResponse
Describes the client's authorization state.
AuthStore
Interface implemented by objects responsible for persisting authentication information between restarts of an app.
FileMetadataBase
FunctionsClient
HasuraAuthClient
HasuraStorageClient
ImageCornerRadiusBase
ImageTransformBase
MultiFactorAuthenticationInfo
Describes information required to perform an MFA sign in.
MultiFactorAuthResponse
NhostClientBase
PresignedUrlBase
ServiceUrls
Requires when constructing SDK for self-host projects
Session
Represents a user-authenticated session with Nhost.
Subdomain
Requires when construction SDK for cloud or localhost
User
Describes an Nhost user.
UserSession
Shares authentication information between service classes.

Constants

authorizationHeader → const String
contentTypeHeader → const String
refreshTokenClientStorageKey → const String
Identifies the refresh token in the HasuraAuthClient's AuthStore instance.
refreshTokenQueryParamName → const String
The query parameter name for the refresh token provided during OAuth provider-based sign-ins.
unauthorizedStatus → const int

Functions

createNhostServiceEndpoint({required String subdomain, required String region, required String service, String apiVersion = 'v1', String protocol = 'https'}) String
Generate Endpoint for each service and based on the subdomain

Typedefs

AuthStateChangedCallback = void Function(AuthenticationState authenticationState)
Signature for callbacks that respond to authentication changes.
SessionRefreshFailedCallback = void Function(Exception error, StackTrace stackTrace)
Signature for callbacks that respond to session refresh failures.
TokenChangedCallback = void Function()
Signature for callbacks that respond to token changes.
UnsubscribeDelegate = void Function()
Signature for functions that remove their associated callback when called.
UploadProgressCallback = void Function(MultipartRequest request, int bytesUploaded, int bytesTotal)
Signature for callbacks that receive the upload progress of ApiClient.postMultipart requests.

Exceptions / Errors

ApiException
Thrown by ApiClient to indicate a failed API call.
NhostException
Base class for exceptions used by the Nhost packages.