setItem( )


Stores an item in local, session, or memory storage.

Note: You can store up to 50kb of data in local and session storage and up to 1mb in memory storage.

Method Declaration
Copy
function setItem(key: string, value: union): void;
Method Parameters
keystringRequired

The key of item to set.


valueunionRequired

The value of the item to set.

JavaScript
import { local } from "wix-storage-frontend"; // ... local.setItem("key", "value");
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?