#typescript sdk for KV?

10 messages · Page 1 of 1 (latest)

faint nacelle
#

Could you tell me if there is a taipescript SDK for kv because I couldn't find it. Just the rest API endpoint I found it.

coral lynx
faint nacelle
#

It's not just about typescript, I'm new with kV. With redis we have a sdk to connect and put and get the key values from database. How can I do that with kV? Just command line for terminal or request API rest by endpoint?

twin merlin
#

The best way is using workers because it will be quickest. The only way to do it outside of workers is with the REST but there is a rate limit of 1200/5 minutes

#

You could write a worker that acts as a REST API endpoint to prevent hitting the Cloudflare API limit

faint nacelle
twin merlin
# faint nacelle My project uses cloudflare pages, made with Nuxt 3 .

Gotcha then you don't need a connect part as KV is auto connected for your project. As @coral lynx metioned the types are a part of workers-types and you can find the API examples with https://developers.cloudflare.com/kv/api/write-key-value-pairs/

To create a new key-value pair, or to update the value for a particular key, call the put() method on any KV namespace you have bound to your Worker …

faint nacelle
#

For local test, I will need to use

#

wrangler dev [<SCRIPT>] [OPTIONS]

#

?