
Saver
Saver - is a library for saving and loading save data in Defold projects. It provides a simple API for saving and loading save data, as well as support for migrations and simple key-value storage. The library supports saving and loading data in JSON, Lua, or binary format, and can save and load files to and from the file system.
Features
- Save and Load Game State: Save and load data with a simple API.
- File Management: Save and load data to and from files.
- Auto-Save: Automatically save data at regular intervals.
- Migrations: Apply migrations to data when the migration version changed.
- Storage: Store key-value pairs in the save data.
- Format support: Save and load data in JSON, Lua or binary format.
Setup
See the Defold Saver repository on Github for the Setup, Documentation, API Reference and Use Cases
Basic Usage
The Saver provides a simple API to bind your Lua tables to the save file. This allows you to set up the Saver only once and continue using the state data as usual.
local saver = require("saver.saver")
local game_data = {
score = 0,
level = 1,
}
function init(self)
saver.init()
saver.bind_save_state("game", game_data)
-- Now we can change game_data content and it will be saved automatically via autosave
game_data.score = game_data.score + 1
-- Or you can save it manually by saver.save_game_state() if you want to save it immediately
saver.save_game_state()
end
Support project 
Your donation helps me stay engaged in creating valuable projects for Defold. If you appreciate what I’m doing, please consider supporting me!

25 Likes
Very fast powerful extension - you can specify a table with game data once and by calling just one function it will be saved, which would be automatically loaded the next time you open it. No additional methods like saver.set or saver.get. Once set up and everything works automatically.
4 Likes
I want to tell about saver.get_current_game_project_folder()
method ( API / Source ). It returns the current project folder where the game.project
file is located. This method only works when the game is launched from the editor.
Often, you might include custom_resources in your game to load data using sys.load_resource()
. These could be game levels, configurations, or settings. However, these files are included in the build before launching the game, and if you change them, you need to restart the game.
With this method, you can get the absolute path to your project folder and load files directly from the disk (only if the game is launched from the editor!).
For example, this is how “hot reload” works in Panthera (example here), or you can create a custom level editor and modify it directly from the game! Previously, I used usual file saving for this 
4 Likes
Hey! The Saver v4 was released
Repo Link: GitHub - Insality/defold-saver: Defold Save File Manager
In this release introducing API to work with the binary files. Previously, saver works only with lua table to load/save from persistent storage.
As example you now can simple storing the images from web like this:
local saver = require("saver.saver")
local file_url = "https://raw.githubusercontent.com/Insality/defold-saver/refs/heads/main/media/logo.png"
http.request(file_url, "GET", function(_, id, response)
if response.status == 200 or response.status == 304 then
saver.save_binary_by_name(response.response, "cache/logo.png")
end
end)
Inspect previous changelogs here
Changelog v4:
- Add binary data handling with explicit API for different file formats
- Previously, this library was designed to save and load a Lua table to persistent storage. But sometimes you want to operate with binary data, like images, audio, etc. Now you can use
saver.save_binary_by_name
/saver.load_binary_by_name
and saver.save_binary_by_path
/saver.load_binary_by_path
for raw binary data.
- Better file format detection and improved internal implementation
- More consistent API for saving and loading files
- Updated documentation and API pages
- Deprecated
saver.storage
module
- Now you should use
saver.set_value
and saver.get_value
for key-value storage
4 Likes