typescript sdk for KV?

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.
7 Replies
James
James12mo ago
The api within workers is fully typed with workers-types and works well: https://developers.cloudflare.com/kv/get-started/ Anything specifically you were looking for with an SDK?
Get started · Cloudflare Workers KV
This guide will instruct you through:
Hermes Alves
Hermes AlvesOP12mo ago
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?
Cyb3r-Jak3
Cyb3r-Jak312mo ago
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
Hermes Alves
Hermes AlvesOP12mo ago
My project uses cloudflare pages, made with Nuxt 3 .
Cyb3r-Jak3
Cyb3r-Jak312mo ago
Gotcha then you don't need a connect part as KV is auto connected for your project. As @James 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/
Write key-value pairs · Cloudflare Workers KV
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 …
Hermes Alves
Hermes AlvesOP12mo ago
For local test, I will need to use wrangler dev [<SCRIPT>] [OPTIONS] ?
James
James12mo ago
Deploy a Nuxt site · Cloudflare Pages docs
Nuxt is a web framework making web Vue.js-based development simple and powerful.
Want results from more Discord servers?
Add your server