Shared storage
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The SharedStorage interface of the Shared Storage API represents the shared storage for a particular origin, defining methods to write data to the shared storage.
SharedStorage is the base class for:
WindowSharedStorage, accessed via Window.sharedStorage.
WorkletSharedStorage, accessed via SharedStorageWorkletGlobalScope.sharedStorage.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
SharedStorage Deprecated | 126 | 126 | | | 126 | |
sharedStorageWritable Deprecated | 126 | 126 | | | 126 | |
sharedStorageWritable Deprecated | 126 | 126 | | | 126 | |
append Deprecated The append() method of the SharedStorage interface appends a string to the value of an existing key-value pair in the current origin's shared storage. | 126 | 126 | | | 126 | |
clear Deprecated The clear() method of the SharedStorage interface clears the current origin's shared storage, removing all data from it. | 126 | 126 | | | 126 | |
createWorklet Deprecated | 126 | 126 | | | 126 | |
delete Deprecated The delete() method of the SharedStorage interface deletes an existing key-value pair from the current origin's shared storage. | 126 | 126 | | | 126 | |
get Deprecated | 126 | 126 | | | 126 | |
run Deprecated | 126 | 126 | | | 126 | |
selectURL Deprecated | 126 | 126 | | | 126 | |
set Deprecated The set() method of the SharedStorage interface either stores a new key-value pair in the current origin's shared storage or updates an existing one. | 126 | 126 | | | 126 | |
worklet Deprecated | 126 | 126 | | | 126 | |
SharedStorageWorklet Deprecated The SharedStorageWorklet interface of the Shared Storage API represents the shared storage worklet for the current origin. | 126 | 126 | | | 126 | |
run Deprecated | 126 | 126 | | | 126 | |
selectURL Deprecated | 126 | 126 | | | 126 | |
SharedStorageWorkletGlobalScope Deprecated The SharedStorageWorkletGlobalScope interface of the Shared Storage API represents the global scope of a SharedStorageWorklet module. | 126 | 126 | | | 126 | |
register Deprecated The register() method of the SharedStorageWorkletGlobalScope interface registers an SharedStorageOperation defined inside the current worklet module. | 126 | 126 | | | 126 | |
sharedStorage Deprecated The context read-only property of the SharedStorageWorkletGlobalScope interface contains a WorkletSharedStorage object instance, which represents the shared storage for a particular origin as exposed to a worklet context. | 126 | 126 | | | 126 | |
sharedStorage Deprecated The global read-only sharedStorage property returns the WindowSharedStorage object for the current origin. This is the main entry point for writing data to shared storage using the Shared Storage API. | 126 | 126 | | | 126 | |
Syntax
// Write data
await window.sharedStorage.set('ab-group', 'experiment');
// Readable only within the worklet
await window.sharedStorage.worklet.addModule('worklet.js');
await window.sharedStorage.run('operation'); Use cases
-
Strengthen integration
Use Shared storage when browser APIs need clearer security boundaries or more explicit capabilities.
-
Connect platform features
Apply Shared storage when your app benefits from deeper browser or device integration.
Cautions
- Test Shared storage in your target browsers and input environments before depending on it as a primary behavior.
- Provide a fallback path or acceptable degradation strategy when support is still limited.
Accessibility
- Make sure Shared storage supports the intended task without making the page harder to perceive, understand, or operate.