MonetizationOS Docs
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

ParameterTypeDescription
bucketSlugstringThe name of the bucket to delete the value from.
keystringThe key to delete. Must be a non-empty string of up to 128 characters.
options?CustomDataOptionsOptional 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

ParameterTypeDescription
bucketSlugstringThe name of the bucket to store the value in.
keystringThe key under which to store the value. Must be a non-empty string of up to 128 characters.
valueunknownThe string value to store. Maximum size is 20MB.
options?CustomDataOptionsOptional settings for the operation, such as crossBrand.

Returns

Promise<void>

Example

ts await utils.buckets.put('bot-config', 'all-sites', { ... }, { crossBrand: true })