Passing type parameter to getWithMetadata

When making a call to a KV, the standard get method allows me to pass a type parameter, of the format “text”, “json”, “arrayBuffer” and “stream”. For example:

NAMESPACE.get(key, “stream”)

If I store metadata with the key-value pair, I can call it as follows:

const {value, metadata} = await NAMESPACE.getWithMetadata(key)

Is there any way to also specify a type, such as “stream”, with the getWithMetadata method?

yes, getWithMetadata also accepts a type as the second argument.

Thanks! Would be great if the API docs made this clear too :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.