Skip to main content

Function: useExportSaves()

useExportSaves(): () => Promise<SaveResult>

Defined in: packages/core/src/saves/hooks/useExportSaves.ts:26

React hook that provides a function to export all game saves to an encrypted file. The exported file is downloaded with the game name, version, and .sx extension.

Returns​

Callback function that exports saves and returns a result object

(): Promise<SaveResult>

Returns​

Promise<SaveResult>

Example​

const exportSaves = useExportSaves();
const handleExport = async () => {
const result = await exportSaves();
if (!result.success) {
console.error('Export failed:', result.error);
}
};