# ClientStorage
Browser storage for plugin data that persists across sessions.

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## ClientStorage interface

Browser storage for plugin data that persists across sessions.

**Signature:**

```typescript
interface ClientStorage
```

## Remarks

- Client storage allows you to store data on the user's browser. Unlike [PluginData](/en/creator-api/types/plugin-data), data stored here is **not** saved with the animation file - it's local to the user's browser only.
- Store values like booleans, numbers, strings, dates, objects, arrays, regexps, undefined, or null.
- The total amount of data you can save per plugin is limited to 5 MB.
- This data is specific to your plugin ID. It will be inaccessible if your plugin ID changes.
- Other plugins cannot access this data. However, you should avoid storing sensitive data here. It is possible for users to inspect this data through browser developer tools.
- As this data is stored on the user's browser, it might be cleared if the user clears their browser data.

## Example

Store and retrieve user preferences:

```ts
await creator.clientStorage.set("theme", "dark");

// Retrieve preferences
const theme = await creator.clientStorage.get("theme"); // "dark"
```

## Methods

<table>
  <thead>
    <tr>
      <th>
        Method
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [clear()](/en/creator-api/types/client-storage/clear)
      </td>

      <td>
        Clears all client storage data for this plugin.
      </td>
    </tr>

    <tr>
      <td>
        [delete(key)](/en/creator-api/types/client-storage/delete)
      </td>

      <td>
        Deletes a value from client storage.
      </td>
    </tr>

    <tr>
      <td>
        [get(key)](/en/creator-api/types/client-storage/get)
      </td>

      <td>
        Retrieves a value from client storage.
      </td>
    </tr>

    <tr>
      <td>
        [keys()](/en/creator-api/types/client-storage/keys)
      </td>

      <td>
        Gets all storage keys for this plugin.
      </td>
    </tr>

    <tr>
      <td>
        [set(key, value)](/en/creator-api/types/client-storage/set)
      </td>

      <td>
        Stores a value in client storage.
      </td>
    </tr>

    <tr>
      <td>
        [usedQuota()](/en/creator-api/types/client-storage/used-quota)
      </td>

      <td>
        Gets the current data quota usage (in bytes) for this plugin.
      </td>
    </tr>
  </tbody>
</table>
