MonetizationOS Docs
Workflows ReferenceType Definitions

ReadonlyBucketWorkflowUtils

type ReadonlyBucketWorkflowUtils = { [P in keyof WriteBucketWorkflowUtils]?: never } & {
  get: Promise<T | null>;
};

Type Declaration

get()

get<T>(
   bucketSlug, 
   key, 
options?): Promise<T | null>;

Retrieve a value from a named bucket by key. Keys must be non-empty strings of up to 128 characters. If the value was written with the 'crossBrand' option, that must be passed here too.

Type Parameters

Type ParameterDescription
TThe expected type of the stored value.

Parameters

ParameterTypeDescription
bucketSlugstringThe name of the bucket to retrieve the value from.
keystringThe key to retrieve. Must be a non-empty string of up to 128 characters.
options?CustomDataOptionsOptional settings for the operation, such as crossBrand.

Returns

Promise<T | null>

The stored string value, or null if not found.

Example

ts const theme = await utils.buckets.get('bot-config', 'all-sites')