Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion _snippets/redis/start-redis-snippet.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>
18 changes: 10 additions & 8 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,13 @@
]
},
{
"group": "Next.js 15",
"group": "Next.js 16",
"pages": [
"redis/quickstarts/nextjs-app-router",
"redis/quickstarts/nextjs-pages-router"
]
},
{
"group": "SST",
"pages": [
"redis/quickstarts/sst-v2",
"redis/quickstarts/ion"
]
},
"redis/quickstarts/sst",
{
"group": "Python",
"pages": [
Expand Down Expand Up @@ -1930,6 +1924,14 @@
]
},
"redirects": [
{
"source": "/redis/quickstarts/ion",
"destination": "/redis/quickstarts/sst"
},
{
"source": "/redis/quickstarts/sst-v2",
"destination": "/redis/quickstarts/sst"
},
{
"source": "/workflow/basics/context",
"destination": "/workflow/steps"
Expand Down
Binary file added img/redis-deno/connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/redis-deno/create.png
Binary file not shown.
Binary file removed img/redis-deno/deploy.png
Binary file not shown.
Binary file added img/redis-deno/env-variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/redis-deno/playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/redis-gcloud/basics.png
Binary file not shown.
Binary file added img/redis-gcloud/create-service.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/redis-gcloud/entry-point.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/redis-gcloud/env-variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/redis-gcloud/environment.png
Binary file not shown.
15 changes: 7 additions & 8 deletions llms-full.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

# README
Expand Down Expand Up @@ -16226,7 +16226,7 @@ customize the eviction behavior according to their specific needs.
Source: https://upstash.com/docs/redis/features/globaldatabase

<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

In the global database, the replicas are distributed across multiple regions
Expand Down Expand Up @@ -20969,7 +20969,7 @@ Upstash Redis is a **highly available, infinitely scalable** Redis-compatible da
* Optional SOC-2 compliance, encryption at rest and much more

<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

***
Expand Down Expand Up @@ -21164,14 +21164,13 @@ We believe that Upstash is the best storage for your Lambda Functions because:
- [Flask](https://upstash.com/docs/redis/quickstarts/flask.md)
- [Fly.io](https://upstash.com/docs/redis/quickstarts/fly.md)
- [Google Cloud Functions](https://upstash.com/docs/redis/quickstarts/google-cloud-functions.md)
- [Ion](https://upstash.com/docs/redis/quickstarts/ion.md)
- [ioredis note](https://upstash.com/docs/redis/quickstarts/ioredisnote.md)
- [Koyeb](https://upstash.com/docs/redis/quickstarts/koyeb.md)
- [Laravel](https://upstash.com/docs/redis/quickstarts/laravel.md)
- [App Router](https://upstash.com/docs/redis/quickstarts/nextjs-app-router.md)
- [Pages Router](https://upstash.com/docs/redis/quickstarts/nextjs-pages-router.md)
- [ AWS Lambda](https://upstash.com/docs/redis/quickstarts/python-aws-lambda.md)
- [SST v2](https://upstash.com/docs/redis/quickstarts/sst-v2.md)
- [AWS Lambda](https://upstash.com/docs/redis/quickstarts/python-aws-lambda.md)
- [SST](https://upstash.com/docs/redis/quickstarts/sst.md)
- [Supabase Functions](https://upstash.com/docs/redis/quickstarts/supabase.md)
- [App Router](https://upstash.com/docs/redis/quickstarts/vercel-functions-app-router.md)
- [Pages Router](https://upstash.com/docs/redis/quickstarts/vercel-functions-pages-router.md)
Expand Down Expand Up @@ -22633,7 +22632,7 @@ redis = Redis(
Source: https://upstash.com/docs/redis/sdks/py/gettingstarted

<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

## Install
Expand Down Expand Up @@ -25044,7 +25043,7 @@ and for his continued efforts to keep it up to date with Upstash.
Source: https://upstash.com/docs/redis/sdks/ts/getstarted

<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

`@upstash/redis` is written in Deno and can be imported from
Expand Down
7 changes: 3 additions & 4 deletions llms.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Upstash Documentation

<Tip>
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to [`https://upstash.com/start-redis`](https://upstash.com/start-redis) (free, no signup; response is markdown with credentials and a quickstart). The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.
</Tip>

## Docs
Expand Down Expand Up @@ -343,14 +343,13 @@
- [Flask](https://upstash.com/docs/redis/quickstarts/flask.md)
- [Fly.io](https://upstash.com/docs/redis/quickstarts/fly.md)
- [Google Cloud Functions](https://upstash.com/docs/redis/quickstarts/google-cloud-functions.md)
- [Ion](https://upstash.com/docs/redis/quickstarts/ion.md)
- [ioredis note](https://upstash.com/docs/redis/quickstarts/ioredisnote.md)
- [Koyeb](https://upstash.com/docs/redis/quickstarts/koyeb.md)
- [Laravel](https://upstash.com/docs/redis/quickstarts/laravel.md)
- [App Router](https://upstash.com/docs/redis/quickstarts/nextjs-app-router.md)
- [Pages Router](https://upstash.com/docs/redis/quickstarts/nextjs-pages-router.md)
- [ AWS Lambda](https://upstash.com/docs/redis/quickstarts/python-aws-lambda.md)
- [SST v2](https://upstash.com/docs/redis/quickstarts/sst-v2.md)
- [AWS Lambda](https://upstash.com/docs/redis/quickstarts/python-aws-lambda.md)
- [SST](https://upstash.com/docs/redis/quickstarts/sst.md)
- [Supabase Functions](https://upstash.com/docs/redis/quickstarts/supabase.md)
- [App Router](https://upstash.com/docs/redis/quickstarts/vercel-functions-app-router.md)
- [Pages Router](https://upstash.com/docs/redis/quickstarts/vercel-functions-pages-router.md)
Expand Down
6 changes: 3 additions & 3 deletions redis/quickstarts/aws-lambda.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: "AWS Lambda"

### Prerequisites

- Complete all steps in [Getting started with the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)
- Complete all steps in [Getting started with the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting-started.html)

### Project Setup

Expand Down Expand Up @@ -69,14 +69,14 @@ export class CounterCdkStack extends cdk.Stack {
const counterFunction = new nodejs.NodejsFunction(this, 'CounterFunction', {
entry: 'api/counter.ts',
handler: 'handler',
runtime: lambda.Runtime.NODEJS_20_X,
runtime: lambda.Runtime.NODEJS_24_X,
environment: {
UPSTASH_REDIS_REST_URL: process.env.UPSTASH_REDIS_REST_URL || '',
UPSTASH_REDIS_REST_TOKEN: process.env.UPSTASH_REDIS_REST_TOKEN || '',
},
bundling: {
format: nodejs.OutputFormat.ESM,
target: "node20",
target: "node24",
nodeModules: ['@upstash/redis'],
},
});
Expand Down
12 changes: 6 additions & 6 deletions redis/quickstarts/azure-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ title: "Azure Functions"

1. [Create an Azure account.](https://azure.microsoft.com/en-us/free/)
2. [Set up Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
3. [Install the Azure Functions Core Tools](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-typescript)
3. [Install the Azure Functions Core Tools](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#install-the-azure-functions-core-tools)

### Project Setup

Initialize the project:

```shell
func init --typescript
func init --worker-runtime node --language typescript
```

Install `@upstash/redis`
Expand Down Expand Up @@ -64,10 +64,10 @@ app.http('CounterFunction', {

### Create Azure Resources

You can use the command below to find the `name` of a region near you.
You can use the command below to find the `name` of a region near you that supports the Flex Consumption plan.

```shell
az account list-locations
az functionapp list-flexconsumption-locations
```

Create a resource group.
Expand All @@ -82,10 +82,10 @@ Create a storage account.
az storage account create --name <STORAGE_NAME> --location <REGION> --resource-group AzureFunctionsQuickstart-rg --sku Standard_LRS --allow-blob-public-access false
```

Create your Function App.
Create your Function App on the Flex Consumption plan.

```shell
az functionapp create --resource-group AzureFunctionsQuickstart-rg --consumption-plan-location <REGION> --runtime node --runtime-version 18 --functions-version 4 --name <APP_NAME> --storage-account <STORAGE_NAME>
az functionapp create --resource-group AzureFunctionsQuickstart-rg --name <APP_NAME> --storage-account <STORAGE_NAME> --flexconsumption-location <REGION> --runtime node --runtime-version 22
```

### Database Setup
Expand Down
55 changes: 32 additions & 23 deletions redis/quickstarts/cloudflareworkers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This will create a new Cloudflare Workers project:


─────────────────────────────────────────────────────────────────────────────────────────────────
👋 Welcome to create-cloudflare v2.50.8!
👋 Welcome to create-cloudflare vX.Y.Z!
🧡 Let's get started.
📊 Cloudflare collects telemetry about your usage of Create-Cloudflare.

Expand Down Expand Up @@ -100,14 +100,12 @@ export interface Env {
}

export default {
async fetch(request, env, ctx): Promise<Response> {
const redis = Redis.fromEnv(env);
const count = await redis.incr("counter");
return new Response(JSON.stringify({ count }));

},
async fetch(request, env, ctx): Promise<Response> {
const redis = Redis.fromEnv(env);
const count = await redis.incr("counter");
return new Response(JSON.stringify({ count }));
},
} satisfies ExportedHandler<Env>;

```

```js src/index.js
Expand All @@ -130,7 +128,20 @@ There are two methods for setting up the credentials for Redis. One for worker l

#### Using Cloudflare Secrets (Worker Level Secrets)

This is the common way of creating secrets for your worker, see [Workflow Secrets](https://developers.cloudflare.com/workers/configuration/secrets/)
This is the common way of creating secrets for your worker, see [Workers Secrets](https://developers.cloudflare.com/workers/configuration/secrets/)

The recommended method is the Wrangler CLI, since secrets added this way persist
across deployments. Navigate to [Upstash Console](https://console.upstash.com),
get your Redis credentials and run in your project directory:

```shell
npx wrangler secret put UPSTASH_REDIS_REST_URL
npx wrangler secret put UPSTASH_REDIS_REST_TOKEN
```

Each command prompts you for the secret value.

Alternatively, you can add the secrets from the dashboard:

- Navigate to [Upstash Console](https://console.upstash.com) and get your Redis credentials.

Expand All @@ -157,15 +168,14 @@ export interface Env {
}

export default {
async fetch(request, env, ctx): Promise<Response> {
const redis = Redis.fromEnv({
UPSTASH_REDIS_REST_URL: await env.UPSTASH_REDIS_REST_URL.get(),
UPSTASH_REDIS_REST_TOKEN: await env.UPSTASH_REDIS_REST_TOKEN.get(),
});
const count = await redis.incr("counter");
return new Response(JSON.stringify({ count }));

},
async fetch(request, env, ctx): Promise<Response> {
const redis = Redis.fromEnv({
UPSTASH_REDIS_REST_URL: await env.UPSTASH_REDIS_REST_URL.get(),
UPSTASH_REDIS_REST_TOKEN: await env.UPSTASH_REDIS_REST_TOKEN.get(),
});
const count = await redis.incr("counter");
return new Response(JSON.stringify({ count }));
},
} satisfies ExportedHandler<Env>;
```

Expand Down Expand Up @@ -203,8 +213,7 @@ Open a different terminal and test the endpoint. Note the destination
url is the same that was printed in the previous deploy step.

```bash
curl -X POST 'https://<your-worker-name>.<account-name>.workers.dev' \
-H 'Content-Type: application/json'
curl https://<your-worker-name>.<account-name>.workers.dev
```

The response will be in the format of `{"count":20}`
Expand All @@ -214,12 +223,12 @@ In the logs you should see something like this:
```bash
$ npx wrangler tail

⛅️ wrangler 4.43.0
⛅️ wrangler X.Y.Z
--------------------

Successfully created tail, expires at 2025-10-16T18:59:18Z
Successfully created tail, expires at <expiry-date>
Connected to <your-worker-name>, waiting for logs...
POST https://<your-worker-name>.<account-name>.workers.dev/ - Ok @ 10/16/2025, 4:05:30 PM
GET https://<your-worker-name>.<account-name>.workers.dev/ - Ok @ <timestamp>
```

## Repositories
Expand Down
72 changes: 47 additions & 25 deletions redis/quickstarts/deno-deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,67 @@ title: "Deno Deploy"
/>

This is a step-by-step guide on how to use Upstash Redis to create a view
counter in your Deno deploy project.
counter in your Deno Deploy project.

### Create a database
### 1. Create a database

Create a Redis database using [Upstash Console](https://console.upstash.com) or
[Upstash CLI](https://github.com/upstash/cli). Select the global to minimize the
latency from all edge locations. Copy the `UPSTASH_REDIS_REST_URL` and
`UPSTASH_REDIS_REST_TOKEN` for the next steps.
`UPSTASH_REDIS_REST_TOKEN` from the **Connect** section of your database for the
next steps.

### Create a Deno deploy project
<Frame>
<img src="/img/redis-deno/connect.png" />
</Frame>

Go to [https://dash.deno.com/projects](https://dash.deno.com/projects) and
create a new playground project.
### 2. Create a Deno Deploy playground

![](/img/redis-deno/create.png)
Go to [https://console.deno.com](https://console.deno.com), open your
organization's **Applications** page and click **New Playground**. This creates
a "Hello World" playground with a browser editor.

### 2. Edit the handler function
<Frame>
<img src="/img/redis-deno/playground.png" />
</Frame>

Then paste the following code into the browser editor:
### 3. Set the environment variables

Click **Env Variables** in the top bar of the playground and add the
`UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` variables. You can add
them one by one with **Add variable**, or paste both lines you copied from the
Upstash Console into **Import from .env file** and click **Import Variables**.

<Frame>
<img src="/img/redis-deno/env-variables.png" />
</Frame>

### 4. Edit the handler function

Paste the following code into the browser editor:

```ts
import { serve } from "https://deno.land/std@0.142.0/http/server.ts";
import { Redis } from "https://deno.land/x/upstash_redis@v1.14.0/mod.ts";

serve(async (_req: Request) => {
if (!_req.url.endsWith("favicon.ico")) {
const redis = new Redis({
url: "UPSTASH_REDIS_REST_URL",
token: "UPSTASH_REDIS_REST_TOKEN",
});

const counter = await redis.incr("deno-counter");
return new Response(JSON.stringify({ counter }), { status: 200 });
import { Redis } from "npm:@upstash/redis";

const redis = new Redis({
url: Deno.env.get("UPSTASH_REDIS_REST_URL")!,
token: Deno.env.get("UPSTASH_REDIS_REST_TOKEN")!,
});

Deno.serve(async (req: Request) => {
if (new URL(req.url).pathname === "/favicon.ico") {
return new Response(null, { status: 404 });
}

const counter = await redis.incr("deno-counter");
return new Response(JSON.stringify({ counter }), {
status: 200,
headers: { "Content-Type": "application/json" },
});
});
```

### 3. Deploy and Run

Simply click on `Save & Deploy` at the top of the screen.
### 5. Deploy and run

![](/img/redis-deno/deploy.png)
Click **Deploy** in the top bar. Once the build finishes, open the playground
URL to see the counter increase on every refresh.
Loading
Loading