Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/content/apps/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ entries:
updated: 2024-06-17
- link: https://github.com/craigsdennis/shorty-dot-dev
name: shrty.dev
description: A URL shortener that makes use of KV and Workers Analytics Engine. The admin interface uses Function Calling. Go Shorty!
description: A URL shortener that makes use of Workers KV and Workers Analytics Engine. The admin interface uses Function Calling. Go Shorty!
tags: [AI, Hono]
products: [Workers AI, KV, Workers]
products: [Workers AI, Workers KV, Workers]
languages: [TypeScript]
cloudflare: true
updated: 2024-07-02
Expand Down Expand Up @@ -200,7 +200,7 @@ entries:
name: Queues Web Crawler
description: An example use-case for Queues, a web crawler built on Browser Rendering and Puppeteer. The crawler finds the number of links to Cloudflare.com on the site, and archives a screenshot to Workers KV.
tags: []
products: [KV, Browser Rendering, Workers, Pages, Queues]
products: [Workers KV, Browser Rendering, Workers, Pages, Queues]
languages: [TypeScript]
cloudflare: true
updated: 2023-06-15
Expand Down Expand Up @@ -303,9 +303,9 @@ entries:
updated: 2024-08-12
- link: https://github.com/atinux/atinotes
name: Atinotes
description: Store Markdown notes in Cloudflare KV with this full-stack application made with Nuxt & deployed on Cloudflare Pages.
description: Store Markdown notes in Cloudflare Workers KV with this full-stack application made with Nuxt & deployed on Cloudflare Pages.
tags: [Nuxt]
products: [Pages, KV]
products: [Pages, Workers KV]
languages: [TypeScript]
cloudflare: false
updated: 2024-08-12
Expand Down
2 changes: 1 addition & 1 deletion src/content/changelogs/kv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ entries:
The unsuccessful keys are an array of keys that were not written successfully to all storage backends and therefore should be retried.

- publish_date: "2024-08-08"
title: New KV Analytics API
title: New Workers KV Analytics API
description: |-

Workers KV now has a new [metrics dashboard](/kv/observability/metrics-analytics/#view-metrics-in-the-dashboard) and [analytics API](/kv/observability/metrics-analytics/#query-via-the-graphql-api) that leverages the [GraphQL Analytics API](/analytics/graphql-api/) used by many other Cloudflare products. The new analytics API provides per-account and per-namespace metrics for both operations and storage, including latency metrics for read and write operations to Workers KV.
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/browser-rendering/get-started/screenshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ In your `browser-worker` directory, install Cloudflare’s [fork of Puppeteer](/
npm install @cloudflare/puppeteer --save-dev
```

## 3. Create a KV namespace
## 3. Create a Workers KV namespace

Browser Rendering can be used with other developer products. You might need a [relational database](/d1/), an [R2 bucket](/r2/) to archive your crawled pages and assets, a [Durable Object](/durable-objects/) to keep your browser instance alive and share it with multiple requests, or [Queues](/queues/) to handle your jobs asynchronous.

For the purpose of this guide, you are going to use a [KV store](/kv/concepts/kv-namespaces/) to cache your screenshots.
For the purpose of this guide, you are going to use a [Workers KV store](/kv/concepts/kv-namespaces/) to cache your screenshots.

Create two namespaces, one for production, and one for development.

Expand All @@ -60,7 +60,7 @@ Take note of the IDs for the next step.

Configure your `browser-worker` project's [`wrangler.toml`](/workers/wrangler/configuration/) file by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Bindings allow your Workers to interact with resources on the Cloudflare developer platform. Your browser `binding` name is set by you, this guide uses the name `MYBROWSER`. Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.

Update your `wrangler.toml` configuration file with the Browser Rendering API binding and the KV namespaces you created:
Update your `wrangler.toml` configuration file with the Browser Rendering API binding and the Workers KV namespaces you created:

```toml
name = "browser-worker"
Expand Down Expand Up @@ -157,9 +157,9 @@ export default {

This Worker instantiates a browser using Puppeteer, opens a new page, navigates to what you put in the `"url"` parameter, takes a screenshot of the page, stores the screenshot in KV, closes the browser, and responds with the JPEG image of the screenshot.

If your Worker is running in production, it will store the screenshot to the production KV namespace. If you are running `wrangler dev`, it will store the screenshot to the dev KV namespace.
If your Worker is running in production, it will store the screenshot to the production Workers KV namespace. If you are running `wrangler dev`, it will store the screenshot to the dev Workers KV namespace.

If the same `"url"` is requested again, it will use the cached version in KV instead, unless it expired.
If the same `"url"` is requested again, it will use the cached version in Workers KV instead, unless it expired.

## 6. Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You can set up External Evaluation rules using any API service, but to get start
npx wrangler kv namespace create "KV"
```

The command will output the binding name and KV namespace ID, for example
The command will output the binding name and Workers KV namespace ID, for example

```txt
[[kv_namespaces]]
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/platform/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Limits for individual queries (listed above) apply to each individual statement

[^1]: The maximum storage per account can be increased by request on Workers Paid and Enterprise plans. See the guidance on limit increases on this page to request an increase.

[^2]: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, KV namespace, environmental variable or secret. Each resource binding is approximately 150-bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.
[^2]: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, Workers KV namespace, environmental variable or secret. Each resource binding is approximately 150-bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.

[^3]: Requests to Cloudflare API must resolve in 30 seconds. Therefore, this duration limit also applies to the entire batch call.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/d1/reference/community-projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Instead of running the `wrangler d1 execute` command in your terminal every time

### L1

`L1` is a package that brings some Cloudflare Worker ecosystem bindings into PHP and Laravel via the Cloudflare API. It provides interaction with D1 via PDO, KV and Queues, with more services to add in the future, making PHP integration with Cloudflare a real breeze.
`L1` is a package that brings some Cloudflare Worker ecosystem bindings into PHP and Laravel via the Cloudflare API. It provides interaction with D1 via PDO, Workers KV and Queues, with more services to add in the future, making PHP integration with Cloudflare a real breeze.

* [GitHub](https://github.com/renoki-co/l1)
* [Packagist](https://packagist.org/packages/renoki-co/l1)
Expand All @@ -102,7 +102,7 @@ Staff Directory is a demo project using D1, [HonoX](https://github.com/honojs/ho

### NuxtHub

`NuxtHub` is a Nuxt module that brings Cloudflare Worker bindings into your Nuxt application with no configuration. It leverages the [Wrangler Platform Proxy](/workers/wrangler/api/#getplatformproxy) in development and direct binding in production to interact with [D1](/d1/), [KV](/kv/) and [R2](/r2/) with server composables (`hubDatabase()`, `hubKV()` and `hubBlob()`).
`NuxtHub` is a Nuxt module that brings Cloudflare Worker bindings into your Nuxt application with no configuration. It leverages the [Wrangler Platform Proxy](/workers/wrangler/api/#getplatformproxy) in development and direct binding in production to interact with [D1](/d1/), [Workers KV](/kv/) and [R2](/r2/) with server composables (`hubDatabase()`, `hubKV()` and `hubBlob()`).

`NuxtHub` also provides a way to use your remote D1 database in development using the `npx nuxt dev --remote` command.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ You will now create a D1 database. In Wrangler v2, there is support for the `wra
npx wrangler d1 create d1-example
```

Reference your created database in your Worker code by creating a [binding](/workers/runtime-apis/bindings/) inside of your `wrangler.toml` file, Wrangler's configuration file. Bindings allow us to access Cloudflare resources, like D1 databases, KV namespaces, and R2 buckets, using a variable name in code. In `wrangler.toml`, set up the binding `DB` and connect it to the `database_name` and `database_id`:
Reference your created database in your Worker code by creating a [binding](/workers/runtime-apis/bindings/) inside of your `wrangler.toml` file, Wrangler's configuration file. Bindings allow us to access Cloudflare resources, like D1 databases, Workers KV namespaces, and R2 buckets, using a variable name in code. In `wrangler.toml`, set up the binding `DB` and connect it to the `database_name` and `database_id`:

```toml
[[ d1_databases ]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ npx wrangler d1 create staff-directory

After creating your database, you will need to set up a [binding](/workers/runtime-apis/bindings/) in the Wrangler configuration file to integrate your database with your application.

This binding enables your application to interact with Cloudflare resources such as D1 databases, KV namespaces, and R2 buckets. To configure this, create a `wrangler.toml` file in your project's root directory and input the basic setup information:
This binding enables your application to interact with Cloudflare resources such as D1 databases, Workers KV namespaces, and R2 buckets. To configure this, create a `wrangler.toml` file in your project's root directory and input the basic setup information:

```toml
name = "staff-directory"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ sidebar:
order: 20
head:
- tag: title
content: Durable Objects - Use KV within Durable Objects
description: Read and write to/from KV within a Durable Object
content: Durable Objects - Use Workers KV within Durable Objects
description: Read and write to/from Workers KV within a Durable Object

---

Expand All @@ -17,7 +17,7 @@ The following Worker script shows you how to configure a <GlossaryTooltip term="

Prerequisites:

* A [KV namespace](/kv/api/) created via the Cloudflare dashboard or the [wrangler CLI](/workers/wrangler/install-and-update/).
* A [Workers KV namespace](/kv/api/) created via the Cloudflare dashboard or the [wrangler CLI](/workers/wrangler/install-and-update/).
* A [configured binding](/kv/concepts/kv-bindings/) for the `kv_namespace` in the Cloudflare dashboard or `wrangler.toml` file.
* A [Durable Object namespace binding](/workers/wrangler/configuration/#durable-objects).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {

* `env` object

* An object containing the bindings associated with your Worker using ES modules format, such as KV namespaces and Durable Objects.
* An object containing the bindings associated with your Worker using ES modules format, such as Workers KV namespaces and Durable Objects.

* `ctx` object
* An object containing the context associated with your Worker using ES modules format. Currently, this object just contains the `waitUntil` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Account-scoped roles apply across an entire Cloudflare account, and through all
| Vectorize Readonly | Can read [Vectorize](/vectorize/) configurations. |
| Waiting Room Admin | Can edit [Waiting Room](/waiting-room/) configuration. |
| Waiting Room Read | Can read [Waiting Room](/waiting-room/) configuration. |
| Workers Admin | Can edit Cloudflare [Workers](/workers/), [Pages](/pages/), [Durable Objects](/durable-objects/), [KV](/kv/) and [R2](/r2/). Also provides read access to Zones, [Zone Analytics](/analytics/account-and-zone-analytics/zone-analytics/) and [Page Rules](/rules/). |
| Workers Admin | Can edit Cloudflare [Workers](/workers/), [Pages](/pages/), [Durable Objects](/durable-objects/), [Workers KV](/kv/) and [R2](/r2/). Also provides read access to Zones, [Zone Analytics](/analytics/account-and-zone-analytics/zone-analytics/) and [Page Rules](/rules/). |
| Zaraz Admin | Can edit and publish [Zaraz](/zaraz/) configuration. |
| Zaraz Edit | Can edit [Zaraz](/zaraz/) configuration. |
| Zaraz Readonly | Can read [Zaraz](/zaraz/) configuration. |
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/kv/api/delete-key-value-pairs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar:

import { GlossaryTooltip } from "~/components"

To delete a key-value pair, call the `delete()` method of the [KV binding](/kv/concepts/kv-bindings/) on any [KV namespace](/kv/concepts/kv-namespaces/) you have bound to your Worker code:
To delete a key-value pair, call the `delete()` method of the [Workers KV binding](/kv/concepts/kv-bindings/) on any [Workers KV namespace](/kv/concepts/kv-namespaces/) you have bound to your Worker code:

```js
env.NAMESPACE.delete(key);
Expand Down Expand Up @@ -38,12 +38,12 @@ export default {

## Reference

The following method is provided to delete from KV:
The following method is provided to delete from Workers KV:
- [delete()](#delete-method)

### `delete()` method

To delete a key-value pair, call the `delete()` method of the [KV binding](/kv/concepts/kv-bindings/) on any KV namespace you have bound to your Worker code:
To delete a key-value pair, call the `delete()` method of the [Workers KV binding](/kv/concepts/kv-bindings/) on any Workers KV namespace you have bound to your Worker code:

```js
env.NAMESPACE.delete(key);
Expand All @@ -62,15 +62,15 @@ env.NAMESPACE.delete(key);

This method returns a promise that you should `await` on to verify successful deletion. Calling `delete()` on a non-existing key is returned as a successful delete.

Calling the `delete()` method will remove the key and value from your KV namespace. As with any operations, it may take some time for the key to be deleted from various points in the Cloudflare global network.
Calling the `delete()` method will remove the key and value from your Workers KV namespace. As with any operations, it may take some time for the key to be deleted from various points in the Cloudflare global network.

## Guidance

### Delete data in bulk

Delete more than one key-value pair at a time with Wrangler or [via the REST API](/api/operations/workers-kv-namespace-delete-multiple-key-value-pairs).

The bulk REST API can accept up to 10,000 KV pairs at once. Bulk writes are not supported using the [KV binding](/kv/concepts/kv-bindings/).
The bulk REST API can accept up to 10,000 KV pairs at once. Bulk writes are not supported using the [Workers KV binding](/kv/concepts/kv-bindings/).

## Other methods to access KV
## Other methods to access Workers KV
You can also [delete key-value pairs from the command line with Wrangler](/kv/reference/kv-commands/#delete) or [with the REST API](/api/operations/workers-kv-namespace-delete-key-value-pair).
10 changes: 5 additions & 5 deletions src/content/docs/kv/api/list-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:

---

To list all the keys in your KV namespace, call the `list()` method of the [KV binding](/kv/concepts/kv-bindings/) on any [KV namespace](/kv/concepts/kv-namespaces/) you have bound to your Worker code:
To list all the keys in your Workers KV namespace, call the `list()` method of the [Workers KV binding](/kv/concepts/kv-bindings/) on any [Workers KV namespace](/kv/concepts/kv-namespaces/) you have bound to your Worker code:


```js
Expand Down Expand Up @@ -39,12 +39,12 @@ export default {

## Reference

The following method is provided to list the keys of KV:
The following method is provided to list the keys of Workers KV:
- [list()](#list-method)

### `list()` method

To list all the keys in your KV namespace, call the `list()` method of the [KV binding](/kv/concepts/kv-bindings/) on any KV namespace you have bound to your Worker code:
To list all the keys in your Workers KV namespace, call the `list()` method of the [Workers KV binding](/kv/concepts/kv-bindings/) on any Workers KV namespace you have bound to your Worker code:

```ts
env.NAMESPACE.list(options?)
Expand Down Expand Up @@ -105,7 +105,7 @@ await NAMESPACE.put(key, "", {
});
```

Changes may take up to 60 seconds (or the value set with `cacheTtl` of the `get()` or `getWithMetadata()` method) to be reflected on the application calling the method on the KV namespace.
Changes may take up to 60 seconds (or the value set with `cacheTtl` of the `get()` or `getWithMetadata()` method) to be reflected on the application calling the method on the Workers KV namespace.

## Guidance

Expand Down Expand Up @@ -158,5 +158,5 @@ await NAMESPACE.put(key, "", {
});
```

## Other methods to access KV
## Other methods to access Workers KV
You can also [list keys on the command line with Wrangler](/kv/reference/kv-commands/#list) or [with the REST API](/api/operations/workers-kv-namespace-list-a-namespace'-s-keys).
Loading
Loading