Browser Storage¶
All OpenSuite apps (OpenSheets, OpenDocs, and OpenPresentation) automatically save your work to the browser's localStorage, ensuring you do not lose data if you accidentally close the tab or refresh the page.
Browser storage is not permanent
Your data is stored only in your current browser. Clearing your browser data, switching browsers, or using incognito mode will erase your local data permanently. Always use File > Save & Share to generate a share link and keep it safe. The share link contains your complete document as a base64 string and serves as your backup.
How It Works¶
Token-Based Identification¶
Each OpenSheets session is identified by an 8-character hex token stored in the URL query parameter ?t=. For example:
- If no token is present when the page loads, a new one is generated automatically using
crypto.getRandomValues. - The token is added to the URL via
history.replaceState(no page reload). - All
localStoragedata is stored under the keyos-{token}, keeping different spreadsheet sessions separate.
Auto-Save Triggers¶
The spreadsheet is automatically saved to localStorage whenever any of these events occur:
- A cell edit is committed
- An undo or redo operation runs
- A command is executed (formatting, insert, delete, etc.)
- A column or row is resized
- A sheet is added, deleted, or renamed
Saves are debounced with a 2-second delay to avoid excessive writes during rapid edits. A final save also runs on beforeunload when the browser tab is closing.
What Is Saved¶
The complete workbook state is serialized to JSON, including:
- All sheets with their cell data, formulas, and formatting
- Saved queries, forms, and custom scripts
- Chart configurations
- A
_savedAttimestamp for conflict resolution
Loading on Page Load¶
When OpenSheets starts, it checks for data in this priority order:
- Supabase (if a
?doc=parameter is present and Supabase is configured) - URL hash (compressed data in the
#fragment) - Browser localStorage (using the
?t=token)
If both a URL hash and browser storage exist, the one with the more recent _savedAt timestamp is used. This ensures that edits made after sharing a URL link are preserved.
Limitations¶
localStorageis limited to approximately 5-10 MB depending on the browser.- Data is stored only in the current browser. Clearing browser data or switching devices will permanently lose the local copy.
- Private/incognito windows clear localStorage when closed -- your data will not persist.
- For persistent cloud storage, enable Supabase integration.
Always keep your share link
Use File > Save & Share regularly to generate a URL that contains your complete document. As long as you have the share link, you can always restore your work by simply opening it in any browser. Think of the share link as your save file.