{"id":17526682,"url":"https://github.com/adaptive/kv","last_synced_at":"2025-07-09T13:39:04.394Z","repository":{"id":37731790,"uuid":"323946179","full_name":"adaptive/kv","owner":"adaptive","description":"Key Value storage solution for Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2025-06-29T19:05:10.000Z","size":551,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-29T20:19:37.875Z","etag":null,"topics":["cloudflare-workers","deno","denodeploy","encryption","hacktoberfest","key-value","kv","stackpath","storage","workers"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adaptive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"adaptive"}},"created_at":"2020-12-23T16:08:02.000Z","updated_at":"2025-06-29T19:05:13.000Z","dependencies_parsed_at":"2023-02-16T16:45:36.887Z","dependency_job_id":"a4c057bb-f7e0-404b-b3a0-fb5f2ead23ac","html_url":"https://github.com/adaptive/kv","commit_stats":{"total_commits":221,"total_committers":2,"mean_commits":110.5,"dds":0.06334841628959276,"last_synced_commit":"7515fd6ecafec2bd085a397f28a49f12c49c99d9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/adaptive/kv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptive%2Fkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptive%2Fkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptive%2Fkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptive%2Fkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adaptive","download_url":"https://codeload.github.com/adaptive/kv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptive%2Fkv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262661033,"owners_count":23344607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-workers","deno","denodeploy","encryption","hacktoberfest","key-value","kv","stackpath","storage","workers"],"created_at":"2024-10-20T15:02:12.164Z","updated_at":"2025-07-09T13:39:04.377Z","avatar_url":"https://github.com/adaptive.png","language":"JavaScript","readme":"# KV Utility\n\n[![npm](https://img.shields.io/npm/v/@adaptivelink/kv.svg)](https://www.npmjs.com/package/@adaptivelink/kv)\n\nA KV storage solution for Cloudflare Workers and Stackpath Serverless Scripting, that uses S3 providers as vendors, like AWS, Wasabi. Optionally you can encrypt your values at rest.\n\n## 🔨 Install with `yarn` or `npm`\n\n```bash\nyarn add @adaptivelink/kv\n```\n\n```bash\nnpm i @adaptivelink/kv\n```\n\n## ⚙️ Environment Variables\n\nYou need to configured the variables (Environment or Global) with your vendor data.\n\n- KV_ACCESS_KEY_ID\n- KV_SECRET_ACCESS_KEY 🔒\n- KV_DEFAULT_REGION\n- KV_S3_BUCKET\n- KV_NAMESPACE_PASSPHRASE 🔒 (optional)\n\n🔒 _Should be stored as environment encrypted variable, avoid global variable._\n\n## 🔓 Basic Usage in Cloudflare \u0026 Stackpath\n\n```javascript\nimport KV from \"@adaptivelink/kv\";\n\nconst NAMESPACE = new KV(\"namespace\");\n\nconst handleRequest = async (event) =\u003e {\n  const keyValue = await NAMESPACE.get(\"key\");\n  event.waitUntil(await NAMESPACE.put(\"hello\", \"world\"));\n};\n```\n\n## 🔐 Usage with Encrypted Values\n\n```javascript\n...\nconst NAMESPACE = new KV(\"namespace\", {\n  passphrase: KV_NAMESPACE_PASSPHRASE,\n});\n...\n```\n\n## 🔩 Methods\n\n### Writing Key-value pair\n\n`await NAMESPACE.put(key, value)`\n\n### Reading Key-value pair\n\n`await NAMESPACE.get(key)`\n\n### Deleting Key-value pair\n\n`await NAMESPACE.get(key)`\n\n🌐 Tested Vendors\n\n|Vendor|Data Consistency|\n|---|---|\n|[AWS S3](https://aws.amazon.com/s3/)|[strong read-after-write](https://aws.amazon.com/s3/consistency/)|\n|[Wasabi](https://wasabi.com/)|[subsecond read-after-write consistency](https://wasabi-support.zendesk.com/hc/en-us/articles/115001684591-What-data-consistency-model-does-Wasabi-employ-)|\n\n## ⚠️ Security Disclaimer\n\nThis software offers no guarantees, we strongly advise that you audit the code.\n\nWhen using encrypted KV option, only the values are encrypted with AES-GCM algorithm. That data is stored at the vendor encrypted, but encrypted/decrypted by the ⚙️ Worker script, meaning that the Isolate will have full access to the values. It would help if you referred to your serverless provider's terms to analyse their scope of access.\n\n## 🥰 Contribution\n\nFeel free to contribute with more features, documentation, and test with more vendors. Send your feedback.","funding_links":["https://github.com/sponsors/adaptive"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptive%2Fkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptive%2Fkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptive%2Fkv/lists"}