module library

Classes

AppleAuthInfo
Authentication info for Sign in with Apple.
AuthenticationKeyManager
Manages keys for authentication with the server.
AuthenticationResponse
Provides a response to an authentication attempt.
AuthKey
Provides a method of access for a user to authenticate with the server.
BadRequestMessage
A message sent when a bad request is received.
Caller
CloseMethodStreamCommand
A message sent over a websocket connection to close a websocket stream of data to an endpoint method.
ConnectivityMonitor
Keeps track of internet connectivity and notifies its listeners when the internet connection is either lost or regained. For most use cases, use the concrete FlutterConnectivityMonitor class in the serverpod_flutter package.
EmailAuth
Database bindings for a sign in with email.
EmailCreateAccountRequest
A request for creating an email signin. Created during the sign up process to keep track of the user's details and verification code.
EmailFailedSignIn
Database table for tracking failed email sign-ins. Saves IP-address, time, and email to be prevent brute force attacks.
EmailPasswordReset
Information about an email password reset.
EmailReset
Database bindings for an email reset.
EndpointAdmin Endpoint
Endpoint for handling admin functions.
EndpointApple Endpoint
Endpoint for handling Sign in with Apple.
EndpointCaller
Super class for all classes that can call a server endpoint.
EndpointEmail Endpoint
Endpoint for handling Sign in with Google.
EndpointFirebase Endpoint
Endpoint for handling Sign in with Firebase.
EndpointGoogle Endpoint
Endpoint for handling Sign in with Google.
EndpointRef
This class connects endpoints on the server with the client, it also hooks up streams with the endpoint. Overridden by generated code.
EndpointStatus Endpoint
Endpoint for getting status for a signed in user and module configuration.
EndpointUser Endpoint
Endpoint with methods for managing the currently signed in user.
FileUploader
The file uploader uploads files to Serverpod's cloud storage. On the server you can setup a custom storage service, such as S3 or Google Cloud. To directly upload a file, you first need to retrieve an upload description from your server. After the file is uploaded, make sure to notify the server by calling the verifyDirectFileUpload on the current Session object.
GoogleRefreshToken
Database bindings for a Google refresh token.
MethodCallContext
Context for a method call.
MethodStreamMessage
A message sent to a method stream.
MethodStreamSerializableException
A serializable exception sent over a method stream.
ModuleEndpointCaller
This class is used to connect modules with the client. Overridden by generated code.
OpenMethodStreamCommand
A message sent over a websocket connection to open a websocket stream of data to an endpoint method.
OpenMethodStreamResponse
A message sent over a websocket connection to respond to an OpenMethodStreamCommand.
PingCommand
A message sent over a websocket connection to check if the connection is still alive. The other end should respond with a PongCommand.
PongCommand
A response to a PingCommand.
Protocol
ProtocolSerialization
The ProtocolSerialization defines a toJsonForProtocol method which makes it possible to limit what fields are serialized
SerializableEntity
DEPRECATED: This class is deprecated and will be removed in version 2.1. Please implement the SerializableModel interface instead for creating serializable models.
SerializableModel
The SerializableModel is the base interface for all serializable objects in Serverpod, except primitives.
SerializationManager
The SerializationManager is responsible for creating objects from a serialization, but also for serializing objects. This class is typically extended by generated code.
ServerpodClientRequestDelegate
Defines the interface of the delegate that performs the actual request to the server and returns the response data. The delegate is used by ServerpodClientShared to perform the actual request. It's overridden in different versions depending on if the dart:io library is available.
ServerpodClientShared
Superclass with shared methods for handling communication with the server. Is typically overridden by generated code to provide implementations of methods for calling the server.
StreamingConnectionHandler
The StreamingConnection handler manages the web socket connection and its state. It will automatically reconnect to the server if the connection is lost. The listener will be notified whenever the connection state changes and once every second when counting down to reconnect. The time between reconnection attempts is specified with retryEverySeconds, default is 5 seconds.
StreamingConnectionHandlerState
Represents the state of the connection handler.
UserImage
Database bindings for a user image.
UserInfo
Information about a user. The UserInfo should only be shared with the user itself as it may contain sensitive information, such as the users email. If you need to share a user's info with other users, use the UserInfoPublic instead. You can retrieve a UserInfoPublic through the toPublic() method.
UserInfoPublic
Information about a user that can safely be publicly accessible.
UserSettingsConfig
User settings.
Uuid
uuid for Dart Author: Yulian Kuncheff Released under MIT License.
UuidValue
WebSocketMessage
Base class for messages sent over a WebSocket connection.

Enums

AuthenticationFailReason
Defines a reason for a failed sign in.
CloseReason
The reason a stream was closed.
Namespace
RFC4122 & RFC9562 provided namespaces for v3, v5, and v8 namespace based UUIDs
OpenMethodStreamResponseType
The response to an OpenMethodStreamCommand.
StreamingConnectionStatus
Status of the streaming connection.
ValidationMode
The options for UUID Validation strictness

Extensions

Base64Dec on String
Extension for decoding ByteData in protocol.
Base64Enc on ByteData
Extension for encoding ByteData in the protocol.
ByteDataJsonExtension on ByteData
Expose toJson on ByteData Expose static fromJson builder
CloneByteData on ByteData
Adds clone method that create a deep copy of a ByteData.
DateTimeJsonExtension on DateTime
Expose toJson on DateTime Expose static fromJson builder
DurationJsonExtension on Duration
Expose toJson on Duration Expose static fromJson builder
ListJsonExtension on List<T>
Expose toJson on List
MapJsonExtension on Map<K, V>
Expose toJson on Map
UserInfoExtension on UserInfo
Convenience methods for the UserInfo class.
UuidValueJsonExtension on UuidValue
Expose toJson on UuidValue Expose static fromJson builder

Constants

autoSerializedTypes → const List<String>
All datatypes that are serialized by default. Used internally in Serverpod code generation.
basicAuthSchemeName → const String
The name of the default Serverpod scheme for HTTP "authorization" headers. Note, the scheme name is case-insensitive and should be compared in a case-insensitive manner.
extensionSerializedTypes → const List<String>
All datatypes that has extensions to support serialization. Used internally in Serverpod code generation.
hasCloneExtensionTypes → const List<String>
List of types that has a clone method extension and therefore can be copied by calling clone().

Properties

nonMutableTypeNames List<String>
List of types that are not mutable and therefore do not need to be copied or handled in a copyWith method.
final

Functions

getType<T>() Type
Get the type provided as an generic. Useful for getting a nullable type.
isValidAuthHeaderValue(String value) bool
Returns true if the provided value is a valid HTTP "authorization" header value (which includes starting with an authentication scheme name).
isWrappedBasicAuthHeaderValue(String value) bool
Returns true if the provided value is a Serverpod-wrapped auth key.
unwrapAuthHeaderValue(String? authValue) String?
Returns the auth key from an auth value that has potentially been wrapped. This operation is the inverse of wrapAsBasicAuthHeaderValue. If null is provided, null is returned.
wrapAsBasicAuthHeaderValue(String key) String
Returns a value that is compliant with the HTTP auth header format by encoding and wrapping the provided auth key as a Basic auth value.

Typedefs

ConnectivityMonitorListener = void Function(bool connected)
Callback for when internet connectivity changes.
VoidCallback = void Function()
A callback with no parameters or return value.

Exceptions / Errors

AuthHeaderEncodingException
An exception thrown upon erroneous encoding of an auth header.
ConnectionAttemptTimedOutException
Thrown if connection attempt timed out.
ConnectionClosedException
Thrown if the connection is closed with an error.
DeserializationTypeNotFoundException
Exception thrown when no deserialization type was found during protocol deserialization
MethodStreamException
Exceptions thrown by the ClientMethodStreamManager.
OpenMethodStreamException
Thrown if opening a method stream fails.
SerializableException
This is SerializableException that can be used to pass Domain exceptions from the Server to the Client
ServerpodClientBadRequest
Thrown if the client created a malformed or invalid request to the server.
ServerpodClientException
Exception thrown when errors in communication with the server occurs.
ServerpodClientForbidden
Thrown if the client is forbidden to perform the request. This is typically due to missing permissions.
ServerpodClientInternalServerError
Thrown if the server encountered an internal error. This is typically a bug in the server code.
ServerpodClientNotFound
Thrown if the requested resource was not found on the server.
ServerpodClientUnauthorized
Thrown if the client fails to authenticate and is therefore not authorized to perform the request.
UnknownMessageException
Exception thrown when an unknown message is received.
WebSocketClosedException
Thrown if the WebSocket connection is closed.
WebSocketConnectException
Thrown if the WebSocket connection fails.
WebSocketListenException
Thrown if an error occurs when listening to the WebSocket connection.