StoreClient (Javascript)
- Tables
-
Product updates
Product updates: January 2023 Product updates: March 2023 Product updates: February 2023 Product updates: April 2023 Product updates: May 2023 Product updates: June 2023 Product updates: July 2023 Product updates: August 2023 Product updates: September 2023 Product updates: October 2023 Product updates: November 2023 Product updates: December 2023 Product updates: January 2024 Product updates: February 2024 Product updates: March 2024 Product updates: April 2024 Product updates: May 2024 Product updates: June 2024 Product updates: July 2024 Product updates: August 2024 Product updates: September 2024 Product updates: October 2024 Product updates: November 2024 Product updates: December 2024 Product updates: January 2025 Product updates: February 2025 Product updates: March 2025 Product updates: April 2025 Product updates: May 2025 Product updates: June 2025 Product updates: July 2025 Product updates: August 2025
- Zaps
- Your Zapier account
- Interfaces
- Canvas
- Chatbots
- Getting started
- Agents
- MCP
- Built-in tools
- Lead Router
- Apps
Table of Contents
Storing and retrieving data with StoreClient
is very simple.
There is no need to require it - it comes pre-imported in your Code environment.
You will need to provide a secret that will protect your data. I recommend using Random.org's excellent password generator. Be very sure you pick a complex secret - if anyone guesses it they'll be able to read and write your data!
Instantiating a client is very simple:
var store = StoreClient('your secret here');
StoreClient
is a promise based library and a great time to get familiar withasync
andawait
!
Most likely you just want to get
and set
some values - this is the simplest possible example:
const store = StoreClient('your secret here');
await store.set('hello', 'world');
const value = await store.get('hello');
return {result: value} // value === 'world'
If the value doesn't exist during your get()
call - it will return a null
value.
Bulk Operations
You can also save and retrieve multiple keys and values - a slightly more complex example:
const store = StoreClient('your secret here');
await store.setMany({hello: 'world', foo: 'bar'})
const values = await store.getMany('hello', 'foo');
// values === {hello: 'world', foo: 'bar'}
await store.deleteMany('hello', 'foo');
// or, if you want to wipe everything
await store.clear();
Note, you can call getMany
and deleteMany
in a few different ways:
store.getMany('hello', 'foo'); // as arguments
store.getMany(['hello', 'foo']); // as array
store.getMany({hello: null, foo: null}); // as object
API
You can also access the stored data via our store API. More info at https://store.zapier.com/
Limitations
- Any JSON serializable value can be saved.
- The secret must be under 32 chars in length.
- Every key must be under 32 chars in length.
- Every value must be under 250 kb.
- Only 500 keys may be saved per secret.
- Keys will expire if you do not touch them in 3 months.