Introduction

To learn more about local, session, or memory storage, see wix-storage-frontend.

Get hands-on experience with the Storage API on our Hello Storage example page.

To use the Frontend Storage API, import the needed storage type(s) from the wix-storage-frontend module:

Copy
Did this help?

clear( )


Removes all items from local, session, or memory storage.

Method Declaration
Copy
Request
This method does not take any parameters
JavaScript
Did this help?

getItem( )


Gets an item from local, session, or memory storage.

If an item does not exist, getItem() resolves to null.

Method Declaration
Copy
function getItem(key: string): string;
Method Parameters
keystringRequired

The key of the item to get.

Returns
Return Type:string
JavaScript
import { local } from "wix-storage-frontend"; // ... let value = local.getItem("key"); // "value"
Did this help?