From 5376cfd6a9ecc604ef10b409b7ffe8bcfc3c7505 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 19 Mar 2026 11:26:20 -0500 Subject: [PATCH] docs: Simplify storage docs --- docs/storage.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/storage.md b/docs/storage.md index 02f9cc39..5eb10a38 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -4,7 +4,7 @@ outline: deep # WXT Storage -[Changelog](https://github.com/wxt-dev/wxt/blob/main/packages/wxt/CHANGELOG.md) +[Changelog](https://github.com/wxt-dev/wxt/blob/main/packages/wxt/CHANGELOG.md) • [API Reference](/api/reference/wxt/utils/storage/interfaces/WxtStorage) A simplified wrapper around the extension storage APIs. @@ -74,7 +74,7 @@ await storage.watch( await storage.getMeta<{ v: number }>('local:installDate'); ``` -For a full list of methods available, see the [API reference](/api/reference/wxt/utils/storage/interfaces/WxtStorage). +> This approach is fine for one-off storage fields or generic helpers, but [defining storage items](#defining-storage-items) is the recommended way to add type-safety. ## Watchers @@ -146,7 +146,7 @@ const showChangelogOnUpdate = storage.defineItem( ); ``` -Now, instead of using the `storage` variable, you can use the helper functions on the storage item you created: +Now, instead of using the `storage` variable, you can use the storage item instead: ```ts await showChangelogOnUpdate.getValue(); @@ -157,8 +157,6 @@ const unwatch = showChangelogOnUpdate.watch((newValue) => { }); ``` -For a full list of properties and methods available, see the [API reference](/api/reference/wxt/utils/storage/interfaces/WxtStorageItem). - ### Versioning You can add versioning to storage items if you expect them to grow or change over time. When defining the first version of an item, start with version 1.