Rawtoh Rawtoh / Docs

Storage

A persistent key-value store for your automation scripts.

Storage is a persistent key-value store scoped to your organization. Your scripts can use it to remember data between executions.

What is it?

Each organization has its own storage — a simple key-value database where keys are strings and values are arbitrary JSON. Storage persists across all script executions, making it perfect for:

Using storage in scripts

Inside your action code, import storage from "rawtoh":

Read a value

import { storage } from "rawtoh"

const count = await storage.get("sub_count")
// Returns the stored value, or undefined if the key doesn't exist

Write a value

import { storage } from "rawtoh"

await storage.set("sub_count", 42)
await storage.set("last_user", { name: "alice", time: Date.now() })
// Values can be any JSON-serializable data

Practical example

import { event, module, storage } from "rawtoh"

// Track how many times each user has used a command
const user = event.payload.user_name
const key = `cmd_count:${user}`

let count = await storage.get(key) || 0
count++
await storage.set(key, count)

await module("twitch").request("chat.say", {
  message: `@${user}, you've used this command ${count} times!`
})

Managing storage in the UI

You can also view and edit storage entries directly from the dashboard. Go to the Storage page in the sidebar to:

This is useful for setting up initial configuration, debugging script state, or manually adjusting values.

Tips