$persistentStore
$persistentStore gives a capture rule script a small key-value store that persists across runs and is shared between scripts. Use it to remember a token, a counter, or any small string between requests. It is available only inside capture rule scripts.
Methods
readreturns the stored string, ornullif the key is absent.writestores a string and returnstrue.removedeletes the key and returnstrue.
If key is omitted, a default key is used.
Notes
- Values are strings. To store structured data, serialize with
JSON.stringifyand parse withJSON.parse. - The store is shared across all capture rule scripts and persists until removed.
