Skip to content

Upgrade Guide: Safer Val Scopes

On Nov 1, 2024, we announced safer default API scopes for vals, which don’t include the val:write scope. Some users were not included in that upgrade, because we detected it might cause some of their vals to break. We reached out to those users on Jan 10, 2025 to give them a month to upgrade their vals. We removed the val:write scope from all those remaining users vals on Feb 11, 2025 unless we heard back from you.

One of the most common uses of the val:write permission is the now-deprecated std.set, since it modifies another val. If you’re seeing an error with std/set, there are two actions you can take, outlined below.

As always, feel free to reach out in #general on Discord or via email if you have any questions or want to set up a time to pair program.

Std/set is deprecated and we now use blob storage with our std/blob library instead. The equivalent function to std.set() is blob.setJSON().

// Using std/set
import { set } from "https://esm.town/v/std/set";
set("createdAt", Date.now());
// Using std/blob
import { blob } from "https://esm.town/v/std/blob";
blob.setJSON("createdAt", Date.now());

Below is a real world example of swapping out std/set for std/blob in a cron val that polls RSS feeds and emails the results:

Using std/blob instead of std/set

If you want to learn more about how to use blob storage, check out our docs here. You can also view and manually edit your blobs by forking this blob admin val.

Add Val Write Permissions to Your Val

Alternatively, you can update your val’s permission scopes so it can create or modify other vals again. To do this:

1. Go to your val’s Settings

Val settings page

2. Scroll down to the Permissions section and select the Vals dropdown

Vals permissions menu

3. Select Read and Write

Read and write dropdown

You’re good to go!