@upstash/qstash 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/nextjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NextApiHandler } from 'next';
2
2
  import { NextRequest, NextFetchEvent } from 'next/server';
3
- import { ae as RouteFunction, af as WorkflowServeOptions } from './client-CsM1dTnz.js';
3
+ import { ae as RouteFunction, af as WorkflowServeOptions } from './client-CUioGZfg.js';
4
4
  import 'neverthrow';
5
5
 
6
6
  type VerifySignatureConfig = {
@@ -18,6 +18,17 @@ type VerifySignatureConfig = {
18
18
  * @default 0
19
19
  */
20
20
  clockTolerance?: number;
21
+ /**
22
+ * Use the local dev server signing keys. Pair this with
23
+ * `new Client({ devMode: true })` for end-to-end local development.
24
+ *
25
+ * - `true`: use dev server signing keys
26
+ * - `false`: never use dev server signing keys (ignores QSTASH_DEV env var)
27
+ * - `undefined`: check QSTASH_DEV env var
28
+ *
29
+ * @default undefined
30
+ */
31
+ devMode?: boolean;
21
32
  };
22
33
  declare function verifySignature(handler: NextApiHandler, config?: VerifySignatureConfig): NextApiHandler;
23
34
  declare function verifySignatureEdge(handler: (request: NextRequest, nfe?: NextFetchEvent) => Response | Promise<Response>, config?: VerifySignatureConfig): (request: NextRequest, nfe: NextFetchEvent) => Promise<Response>;
@@ -43,5 +54,25 @@ declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TI
43
54
  * Migration Guide: https://upstash.com/docs/workflow/migration
44
55
  */
45
56
  declare const servePagesRouter: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options?: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish">) => NextApiHandler;
57
+ /**
58
+ * Start the QStash dev server early during Next.js initialization.
59
+ *
60
+ * Call this inside your `instrumentation.ts` `register()` function so
61
+ * the dev server is ready before any request — including edge routes
62
+ * that cannot start it themselves.
63
+ *
64
+ * No-op in production, during `next build`, or in edge runtime.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * // instrumentation.ts
69
+ * import { registerQStashDev } from "@upstash/qstash/nextjs";
70
+ *
71
+ * export function register() {
72
+ * registerQStashDev();
73
+ * }
74
+ * ```
75
+ */
76
+ declare function registerQStashDev(): Promise<void>;
46
77
 
47
- export { type VerifySignatureConfig, serve, servePagesRouter, verifySignature, verifySignatureAppRouter, verifySignatureEdge };
78
+ export { type VerifySignatureConfig, registerQStashDev, serve, servePagesRouter, verifySignature, verifySignatureAppRouter, verifySignatureEdge };