The Supabase UE5 Plugin provides a comprehensive set of well-defined data structures (USTRUCT) for handling various types of data exchange between Unreal Engine and Supabase. These structures are Blueprint-friendly and designed for robust serialization/deserialization.
Primary user data structure for Supabase authentication.
USTRUCT(BlueprintType)
struct FUser
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FString Id;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FString Email;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FString Role;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FString ConfirmedAt;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FString LastSignInAt;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
FAppMetadata AppMetadata;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
TArray<FIdentity> Identities;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase User")
bool IsAnonymous = false;
};
Token authentication response structure.
USTRUCT(BlueprintType)
struct FTokenResponse
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (JsonField = "access_token"))
FString AccessToken;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (JsonField = "token_type"))
FString TokenType;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (JsonField = "expires_in"))
int32 ExpiresIn = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (JsonField = "refresh_token"))
FString RefreshToken;
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (JsonField = "user"))
FUser User;
};
User identity provider information.
USTRUCT(BlueprintType)
struct FIdentity
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Models")
FString IdentityId;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Models")
FString Provider;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Models")
FIdentityData IdentityData;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Models")
FString CreatedAt;
};
Core structure for actor persistence and serialization.
USTRUCT(BlueprintType)
struct FActorData
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistent Data")
FString ActorID;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistent Data")
FTransform Transform;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistent Data")
TMap<FString, FString> CustomData;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistent Data")
FString LevelName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistent Data")
TSoftClassPtr<AActor> ActorClass;
// Built-in JSON serialization methods
bool Serialize(TSharedRef<TJsonWriter<>> Writer) const;
bool Deserialize(const TSharedPtr<FJsonObject>& JsonObject);
};
Key Features:
Simplified persistence structure for basic actor data.
USTRUCT(BlueprintType)
struct FActorPersistenceData
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Persistence")
FString ActorId;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Persistence")
FTransform ActorTransform;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Persistence")
FString LevelName;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Persistence")
FString CustomData;
};
Database model for persistent actor storage.
USTRUCT(BlueprintType)
struct FSupabasePersistentActor
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
int64 Id = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
FString CreatedAt;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
FString LastUpdatedAt;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
FString LevelName;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
FString ActorId;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Supabase Model")
FActorPersistenceData ActorData;
};
Defines individual table column properties.
USTRUCT(BlueprintType)
struct FTableColumn
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
FString Name;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
FString Type;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
bool bNotNull = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
bool bUnique = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
bool bPrimaryKey = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
FString DefaultValue;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
FString References; // For foreign keys: "other_table(column)"
};
Supported PostgreSQL/Supabase Types:
text, varchar, char - Text datainteger, bigint, smallint - Numeric dataserial, bigserial - Auto-incrementing integersboolean - True/false valuesreal, double, numeric - Floating point numberstimestamp, date, time - Date/time datauuid - Unique identifiersjson, jsonb - JSON databytea - Binary dataComplete table definition structure.
USTRUCT(BlueprintType)
struct FTableSchema
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
TArray<FTableColumn> Columns;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
bool bEnableRLS = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Table Schema")
FString TableComment;
};
Dynamic struct wrapper for flexible data handling.
USTRUCT(BlueprintType)
struct FGenericStructWrapper
{
GENERATED_BODY()
void* StructData;
UScriptStruct* StructType;
template <typename T>
T* GetTypedStruct();
template <typename T>
static FGenericStructWrapper CreateWrapper(const T& StructInstance);
void CleanUp();
};
Key Features:
Configuration structure for entity persistence behavior.
USTRUCT(BlueprintType)
struct FEntityPersistenceConfig
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
bool bAutoSave = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
float AutoSaveInterval = 300.0f; // 5 minutes
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
bool bAutoLoad = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
bool bAutoCreateTable = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
bool bSaveTransformOnly = false;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
bool bSaveOnDestroy = true;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Persistence Config")
FString CustomTableName;
};
The plugin provides comprehensive JSON serialization through USupabaseUtils:
// Serialize any USTRUCT to JSON string
UFUNCTION(BlueprintCallable, Category = "Supabase|Utils")
static bool SerializeUStructToJSONString(const int32& Struct, FString& OutJsonString, FString& OutErrorMessage);
// Deserialize JSON string to USTRUCT
UFUNCTION(BlueprintCallable, Category = "Supabase|Utils")
static bool DeserializeStructFromJSONString(const FString& JsonString, int32& Struct, FString& OutErrorMessage);
// Work with JSON objects
UFUNCTION(BlueprintCallable, Category = "Supabase|Utils")
static bool SerializeUStructToJSONObject(const int32& Struct, FJsonObjectWrapper& OutJsonObject, FString& OutErrorMessage);
Blueprint-friendly JSON object handling:
UCLASS(BlueprintType)
class USupabaseJsonObjectWrapper : public UObject
{
UFUNCTION(BlueprintCallable, Category = "JSON")
FString GetJsonString() const;
UFUNCTION(BlueprintCallable, Category = "JSON")
bool IsObject() const;
UFUNCTION(BlueprintCallable, Category = "JSON")
FString GetStringField(const FString& FieldName) const;
};
USTRUCT(BlueprintType)
struct FMyGameData
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Data")
FString PlayerName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Data")
int32 Score = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Data")
TArray<FString> Achievements;
FMyGameData()
{
PlayerName = TEXT("");
Score = 0;
}
};
// C++ Example
FMyGameData GameData;
GameData.PlayerName = TEXT("Player1");
GameData.Score = 1000;
FString JsonString;
if (FJsonObjectConverter::UStructToJsonObjectString(GameData, JsonString))
{
// Use JsonString with Supabase operations
}
For the latest updates and API changes, refer to the plugin changelog and GitHub repository.