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 Parameter | Description |
|---|---|
T | The expected type of the stored value. |
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to retrieve the value from. |
key | string | The key to retrieve. Must be a non-empty string of up to 128 characters. |
options? | CustomDataOptions | Optional 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')