persistentStore, which persists across runs, attemptStore is temporary and only available during the current execution. It can store any JavaScript object, not just JSON-serializable data—making it ideal for sharing initialized objects, clients, or context across your automation.
Common use cases
Sharing context — Store initialized dependencies, loggers, API clients, or configuration objects that you want to access from multiple functions without passing them as arguments. Set them up in a hook and retrieve them in your automation—useful for libraries like Stagehand or Browser Use. Sharing data within an automation — Store intermediate results that you need to access later in the same execution.Store
Method reference
get
The key to retrieve the value for.
undefined if not found.
set
The key to set the value for.
The value to store.
void.
Related
- Setup hooks recipe — Learn how to initialize dependencies in hooks.
- Stagehand integration — Using Stagehand with attemptStore.
- Browser Use integration — Using Browser Use with attemptStore.