Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The keys() method of the WorkletSharedStorage interface returns an async iterator, which contains the keys for each item in a WorkletSharedStorage instance.
keys()
None.
An array of the WorkletSharedStorage's enumerable property keys.
TypeErrorThrown if the calling site does not have the Shared Storage API included in a successful privacy sandbox enrollment process.
// keys() available inside a shared storage worklet module
const storage = await this.sharedStorage;
async function logKeys() {
for await (const key of storage.keys()) {
console.log(key);
}
}
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkletSharedStorage/keys