Workflows ReferenceType Definitions
WriteBucketWorkflowUtils
type WriteBucketWorkflowUtils = {
delete: Promise<void>;
put: Promise<void>;
};Methods
delete()
delete(
bucketSlug,
key,
options?): Promise<void>;Delete a value from a named bucket by key. If the value was written with the 'crossBrand' option, that must be passed here too. Deleting a non-existent key will return successfully.
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to delete the value from. |
key | string | The key to delete. Must be a non-empty string of up to 128 characters. |
options? | CustomDataOptions | Optional settings for the operation, such as crossBrand. |
Returns
Promise<void>
Example
ts await utils.buckets.delete('user-preferences', 'theme')
put()
put(
bucketSlug,
key,
value,
options?): Promise<void>;Store a value in a named bucket under a specific key. Keys must be non-empty strings of up to 128 characters. Values can be up to 20MB. If the 'crossBrand' option is set, the data will be accessible across brands.
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to store the value in. |
key | string | The key under which to store the value. Must be a non-empty string of up to 128 characters. |
value | unknown | The string value to store. Maximum size is 20MB. |
options? | CustomDataOptions | Optional settings for the operation, such as crossBrand. |
Returns
Promise<void>
Example
ts await utils.buckets.put('bot-config', 'all-sites', { ... }, { crossBrand: true })