Returns Promise<undefined | KeyValueStore>
You can use the
bufferoption to get the value in a Buffer (Node.js) or ArrayBuffer (browser) format. In Node.js (not in browser) you can also use the
streamoption to get a Readable stream.
When the record does not exist, the function resolves to
undefined. It does NOT resolve to a
KeyValueStorerecord with an
Returns Promise<undefined | KeyValueStoreRecord<JsonValue>>
The value in the record can be a stream object (detected by having the
.onmethods). However, note that in that case following redirects or retrying the request if it fails (for example due to rate limiting) isn’t possible. If you want to keep that behavior, you need to collect the whole stream contents into a Buffer and then send the full buffer. See this StackOverflow answer for an example how to do that.