Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 5, 2023
1 parent cc644a3 commit 70d012f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions docs/content/6.drivers/vercel-kv.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
# Vercel KV

Store data in a Vercel [Redis](https://redis.com/) KV store.
Store data in a [Vercel KV Store](https://vercel.com/docs/storage/vercel-kv).

```js
import { createStorage } from "unstorage";
import vercelDriver from "unstorage/drivers/vercel-kv";
import vercelKVDriver from "unstorage/drivers/vercel-kv";

const storage = createStorage({
driver: vercelDriver({
base: "unstorage",
driver: vercelKVDriver({
// base: "unstorage",
url: "https://<your-project-slug>.kv.vercel-storage.com",
token: "<your secret token>",
}),
});
```

**Options:**

- `base`: Optional prefix to use for all keys. Can be used for namespacing.
- `url`: Url to use for connecting to your Vercel KV store. It has the format `https://<your-project-slug>.kv.vercel-storage.com`

See [@upstash/redis](https://docs.upstash.com/redis/sdks/javascriptsdk/advanced) for all available options.

To use, you will need to install `@vercel/kv` in your project:
To use, you will need to install `@vercel/kv` dependency in your project:

```json
{
Expand All @@ -31,3 +24,12 @@ To use, you will need to install `@vercel/kv` in your project:
}
}
```

**Note:** For driver options type support, you might need to install `@upstash/redis` dev dependency as well.

**Options:**

- `base`: Optional prefix to use for all keys. Can be used for namespacing.
- `url`: Url to use for connecting to your Vercel KV store. It has the format `https://<your-project-slug>.kv.vercel-storage.com`

See [@upstash/redis](https://docs.upstash.com/redis/sdks/javascriptsdk/advanced) for all available options.

0 comments on commit 70d012f

Please sign in to comment.