You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: document automatic qstash dev server in JS SDK
Documents the new devMode option in @upstash/qstash that downloads,
starts, and manages the QStash dev server automatically. Adds a
prominent section in the Local Development how-to and a quick mention
in the TS SDK getting started page.
* refactor: reorganize local-development page
- Split intro paragraph
- Group manual install methods under 'Running the dev server manually'
- Rename 'NPX' -> '@upstash/qstash-cli', 'Artifact Repository' -> 'Direct download', 'QStash CLI' -> 'CLI reference'
- Promote test users to its own h2
Also tightens the Automatic dev server section: leads with QSTASH_DEV
env, drops redundant copy, and moves the production no-op into a
warning callout.
* docs: document automatic qstash dev server in workflow guide
* docs: remove obsolete note about missing GUI client for dev server
* chore(llms): regenerate llms.txt and llms-full.txt
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
QStash requires a publicly available API to send messages to.
8607
8607
During development when applications are not yet deployed, developers typically need to expose their local API by creating a public tunnel.
8608
-
While local tunneling works seamlessly, it requires code changes between development and production environments and increase friction for developers.
8608
+
8609
+
While local tunneling works seamlessly, it requires code changes between development and production environments and increases friction for developers.
8609
8610
To simplify the development process, Upstash provides QStash CLI, which allows you to run a development server locally for testing and development.
8610
8611
8611
8612
<Check>The development server fully supports all QStash features including Schedules, URL Groups, Workflows, and Event Logs.</Check>
8612
8613
8613
8614
<Note>Since the development server operates entirely in-memory, all data is reset when the server restarts.</Note>
8614
8615
8615
-
You can download and run the QStash CLI executable binary in several ways:
8616
+
## Automatic dev server (JavaScript SDK)
8617
+
8618
+
If you are using `@upstash/qstash`, you can just set `QSTASH_DEV=true` in your environment variables, and the SDK will download and connect to the dev server automatically.
8619
+
8620
+
```bash .env
8621
+
QSTASH_DEV=true
8622
+
```
8623
+
8624
+
Additionally, you can pass `devMode: true` to explicitly enable dev mode:
8625
+
8626
+
```typescript
8627
+
import { Client } from "@upstash/qstash";
8628
+
8629
+
const client = new Client({ devMode: true });
8630
+
8631
+
await client.publishJSON({
8632
+
url: "https://example.com/webhook",
8633
+
body: { hello: "world" },
8634
+
});
8635
+
```
8636
+
8637
+
```typescript
8638
+
// app/api/webhook/route.ts
8639
+
import { verifySignatureAppRouter } from "@upstash/qstash/nextjs";
8640
+
8641
+
export const POST = verifySignatureAppRouter(
8642
+
async (request) => {
8643
+
// signed by the local dev server
8644
+
return new Response("ok");
8645
+
},
8646
+
{ devMode: true }
8647
+
);
8648
+
```
8649
+
8650
+
On startup the SDK prints the dev server URL and a link to the Upstash Console:
8651
+
8652
+
```
8653
+
[QStash Dev] Server running at http://127.0.0.1:8080
* Download the latest `qstash` binary on first use, cached in your OS cache directory:
8660
+
* macOS: `~/Library/Caches/upstash/qstash-dev`
8661
+
* Linux: `~/.cache/upstash/qstash-dev`
8662
+
* Windows: `%LOCALAPPDATA%\upstash\qstash-dev`
8663
+
* Spawn the server on port `8080` (override with `QSTASH_DEV_PORT`).
8664
+
* Confirm the server is running on the configured port and skip spawning if it is.
8665
+
* Override the `baseUrl`, `token`, and signing keys you provide and use the dev server's instead.
8666
+
8667
+
<Warning>
8668
+
Dev mode is automatically a no-op when `NODE_ENV=production` and in browser/edge runtimes.
8669
+
</Warning>
8670
+
8671
+
### Next.js edge routes
8672
+
8673
+
If you are using edge routes in Next.js, the SDK cannot spawn the dev server from the edge runtime — it can only verify it is reachable. To start the server before any edge request hits, call `registerQStashDev()` from `instrumentation.ts`:
8674
+
8675
+
```typescript
8676
+
// instrumentation.ts
8677
+
import { registerQStashDev } from "@upstash/qstash/nextjs";
docker run -p 8080:8080 public.ecr.aws/upstash/qstash:latest qstash dev
8645
8714
```
8646
8715
8647
-
## Artifact Repository
8716
+
### Direct download
8648
8717
8649
8718
You can download the binary directly from our artifact repository without using a package manager:
8650
8719
@@ -8657,7 +8726,7 @@ After extracting the archive file, run the executable:
8657
8726
$ ./qstash dev
8658
8727
```
8659
8728
8660
-
## QStash CLI
8729
+
## CLI reference
8661
8730
8662
8731
Currently, the only available command for QStash CLI is `dev`, which starts a development server instance.
8663
8732
@@ -8684,6 +8753,8 @@ Running `qstash dev` starts two components:
8684
8753
$ ./qstash dev -port=8080 -log-port=9000
8685
8754
```
8686
8755
8756
+
## Test users
8757
+
8687
8758
There are predefined test users available. You can configure the quota type of users using the `-quota` option, with available options being `payg` and `pro`.
8688
8759
These quotas don't affect performance but allow you to simulate different server limits based on the subscription tier.
<Info>Currently, there is no GUI client available for the development server. You can use QStash SDKs to fetch resources like event logs.</Info>
8726
-
8727
8796
## License
8728
8797
8729
8798
The QStash development server is licensed under the [Development Server License](/docs/qstash/misc/license), which restricts its use to development and testing purposes only.
@@ -11569,6 +11638,18 @@ const client = new Client({
11569
11638
});
11570
11639
```
11571
11640
11641
+
## Local development
11642
+
11643
+
Pass `devMode: true` (or set `QSTASH_DEV=true`) to have the SDK download, start, and manage a local QStash dev server for you. No tokens or signing keys required — the SDK injects deterministic dev credentials.
11644
+
11645
+
```typescript
11646
+
import { Client } from "@upstash/qstash";
11647
+
11648
+
const client = new Client({ devMode: true });
11649
+
```
11650
+
11651
+
The same flag works on the receiving side — pass `devMode: true` to `Receiver` or `verifySignature*` to verify signatures with the dev server's keys. See [Local Development](/docs/qstash/howto/local-development) for the full walkthrough, including the `registerQStashDev()` helper for Next.js edge routes.
11652
+
11572
11653
## Telemetry
11573
11654
11574
11655
This sdk sends anonymous telemetry headers to help us improve your experience.
Upstash Workflow is built on top of Upstash QStash.
50814
50895
The QStash CLI provides a local development server that performs QStash functionality locally for development and testing purposes.
50815
50896
50897
+
## Automatic dev server (recommended)
50898
+
50899
+
If you are using `@upstash/workflow`, you can just set `QSTASH_DEV=true` in your environment, and the SDK will download and connect to the dev server automatically. No tokens or signing keys required.
50900
+
50901
+
```bash .env
50902
+
QSTASH_DEV=true
50903
+
```
50904
+
50905
+
With `QSTASH_DEV=true` set, both the workflow client and the `serve()` endpoint pick up the dev server automatically. The endpoint also verifies incoming signatures against the dev server's deterministic signing keys, so signature verification works end-to-end with no extra setup.
50906
+
50907
+
```typescript
50908
+
// app/api/workflow/route.ts
50909
+
import { serve } from "@upstash/workflow/nextjs";
50910
+
50911
+
export const { POST } = serve(async (context) => {
const client = new Client({ token: process.env.QSTASH_TOKEN ?? "" });
50920
+
50921
+
await client.trigger({
50922
+
url: "http://localhost:3000/api/workflow",
50923
+
});
50924
+
```
50925
+
50926
+
For details on the dev server behavior, ports, and the `registerQStashDev()` helper for Next.js edge routes, see the [QStash Local Development docs](/docs/qstash/howto/local-development).
50927
+
50928
+
## Manual setup
50929
+
50930
+
If you would rather start and manage the QStash dev server yourself, follow the steps below.
50931
+
50816
50932
<Steps>
50817
50933
<Step title="Install and Start Development Server">
50818
50934
Start the development server using the QStash CLI:
Copy file name to clipboardExpand all lines: qstash/howto/local-development.mdx
+78-9Lines changed: 78 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,87 @@
2
2
title: "Local Development"
3
3
---
4
4
5
-
QStash requires a publicly available API to send messages to.
5
+
QStash requires a publicly available API to send messages to.
6
6
During development when applications are not yet deployed, developers typically need to expose their local API by creating a public tunnel.
7
-
While local tunneling works seamlessly, it requires code changes between development and production environments and increase friction for developers.
7
+
8
+
While local tunneling works seamlessly, it requires code changes between development and production environments and increases friction for developers.
8
9
To simplify the development process, Upstash provides QStash CLI, which allows you to run a development server locally for testing and development.
9
10
10
11
<Check>The development server fully supports all QStash features including Schedules, URL Groups, Workflows, and Event Logs.</Check>
11
12
12
13
<Note>Since the development server operates entirely in-memory, all data is reset when the server restarts.</Note>
13
14
14
-
You can download and run the QStash CLI executable binary in several ways:
15
+
## Automatic dev server (JavaScript SDK)
16
+
17
+
If you are using `@upstash/qstash`, you can just set `QSTASH_DEV=true` in your environment variables, and the SDK will download and connect to the dev server automatically.
18
+
19
+
```bash .env
20
+
QSTASH_DEV=true
21
+
```
22
+
23
+
Additionally, you can pass `devMode: true` to explicitly enable dev mode:
- Download the latest `qstash` binary on first use, cached in your OS cache directory:
59
+
- macOS: `~/Library/Caches/upstash/qstash-dev`
60
+
- Linux: `~/.cache/upstash/qstash-dev`
61
+
- Windows: `%LOCALAPPDATA%\upstash\qstash-dev`
62
+
- Spawn the server on port `8080` (override with `QSTASH_DEV_PORT`).
63
+
- Confirm the server is running on the configured port and skip spawning if it is.
64
+
- Override the `baseUrl`, `token`, and signing keys you provide and use the dev server's instead.
65
+
66
+
<Warning>
67
+
Dev mode is automatically a no-op when `NODE_ENV=production` and in browser/edge runtimes.
68
+
</Warning>
69
+
70
+
### Next.js edge routes
71
+
72
+
If you are using edge routes in Next.js, the SDK cannot spawn the dev server from the edge runtime — it can only verify it is reachable. To start the server before any edge request hits, call `registerQStashDev()` from `instrumentation.ts`:
docker run -p 8080:8080public.ecr.aws/upstash/qstash:latest qstash dev
44
113
```
45
114
46
-
##Artifact Repository
115
+
### Direct download
47
116
48
117
You can download the binary directly from our artifact repository without using a package manager:
49
118
@@ -56,7 +125,7 @@ After extracting the archive file, run the executable:
56
125
$ ./qstash dev
57
126
```
58
127
59
-
## QStash CLI
128
+
## CLI reference
60
129
61
130
Currently, the only available command for QStash CLI is `dev`, which starts a development server instance.
62
131
@@ -83,6 +152,8 @@ Running `qstash dev` starts two components:
83
152
$ ./qstash dev -port=8080 -log-port=9000
84
153
```
85
154
155
+
## Test users
156
+
86
157
There are predefined test users available. You can configure the quota type of users using the `-quota` option, with available options being `payg` and `pro`.
87
158
These quotas don't affect performance but allow you to simulate different server limits based on the subscription tier.
<Info>Currently, there is no GUI client available for the development server. You can use QStash SDKs to fetch resources like event logs.</Info>
125
-
126
195
## License
127
196
128
197
The QStash development server is licensed under the [Development Server License](/qstash/misc/license), which restricts its use to development and testing purposes only.
Copy file name to clipboardExpand all lines: qstash/sdks/ts/gettingstarted.mdx
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,18 @@ const client = new Client({
46
46
});
47
47
```
48
48
49
+
## Local development
50
+
51
+
Pass `devMode: true` (or set `QSTASH_DEV=true`) to have the SDK download, start, and manage a local QStash dev server for you. No tokens or signing keys required — the SDK injects deterministic dev credentials.
52
+
53
+
```typescript
54
+
import { Client } from"@upstash/qstash";
55
+
56
+
const client =newClient({ devMode: true });
57
+
```
58
+
59
+
The same flag works on the receiving side — pass `devMode: true` to `Receiver` or `verifySignature*` to verify signatures with the dev server's keys. See [Local Development](/qstash/howto/local-development) for the full walkthrough, including the `registerQStashDev()` helper for Next.js edge routes.
60
+
49
61
## Telemetry
50
62
51
63
This sdk sends anonymous telemetry headers to help us improve your experience.
Copy file name to clipboardExpand all lines: workflow/howto/local-development/development-server.mdx
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,40 @@ title: "Development Server"
5
5
Upstash Workflow is built on top of Upstash QStash.
6
6
The QStash CLI provides a local development server that performs QStash functionality locally for development and testing purposes.
7
7
8
+
## Automatic dev server (recommended)
9
+
10
+
If you are using `@upstash/workflow`, you can just set `QSTASH_DEV=true` in your environment, and the SDK will download and connect to the dev server automatically. No tokens or signing keys required.
11
+
12
+
```bash .env
13
+
QSTASH_DEV=true
14
+
```
15
+
16
+
With `QSTASH_DEV=true` set, both the workflow client and the `serve()` endpoint pick up the dev server automatically. The endpoint also verifies incoming signatures against the dev server's deterministic signing keys, so signature verification works end-to-end with no extra setup.
For details on the dev server behavior, ports, and the `registerQStashDev()` helper for Next.js edge routes, see the [QStash Local Development docs](/qstash/howto/local-development).
38
+
39
+
## Manual setup
40
+
41
+
If you would rather start and manage the QStash dev server yourself, follow the steps below.
8
42
9
43
<Steps>
10
44
<Steptitle="Install and Start Development Server">
0 commit comments