Skip to content

Restructured the realtime docs #2317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

D-K-P
Copy link
Member

@D-K-P D-K-P commented Jul 25, 2025

No description provided.

Copy link

changeset-bot bot commented Jul 25, 2025

⚠️ No Changeset found

Latest commit: 1a8cf5b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Walkthrough

This change reorganizes and expands the documentation structure for the Trigger.dev Realtime API. The navigation in docs.json was updated: the "Frontend usage" section is now "Realtime," with new and reorganized pages, including a "React hooks (frontend)" subgroup and a renamed "Backend" subgroup. Several documentation files were added, removed, or rewritten. New pages cover topics such as how the realtime system works, the run object schema, backend subscription functions, metadata, and streams. The React hooks documentation was restructured, with new overview, realtime, streams, SWR, and triggering pages. Outdated or redundant documentation files were deleted, and frontend-specific examples were moved out of backend-focused docs. URL redirects were updated to match the new structure, ensuring legacy links remain functional.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Complexity: Moderate. The changes are extensive in documentation scope, involving navigation restructuring, content rewrites, new guides, and multiple file additions and deletions. However, no application code or exported entities are affected, and the changes are self-contained within documentation and configuration.
  • Volume: Dozens of documentation files are involved, with several major new guides and significant content movement.
  • Estimated review time: A thorough review would require checking the new structure, verifying the accuracy and clarity of new/updated guides, ensuring redirects work as intended, and confirming that removed content is properly replaced or consolidated. This is estimated to take approximately 20 minutes for a reviewer familiar with the documentation and subject matter.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/realtime-docs-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
docs/realtime/react-hooks/triggering.mdx (1)

80-93: Early return short-circuits realtime updates

The if (handle) { return … } block renders immediately after a task is triggered, preventing the component from ever reaching the realtime subscription branch where run is updated. A minimal re-ordering keeps the UI responsive while still showing progress.

-  if (handle) {
-    return <div>Run ID: {handle.id}</div>;
-  }
-
-  if (realtimeError) {
+  if (realtimeError) {
     return <div>Error: {realtimeError.message}</div>;
   }
 
-  if (run) {
-    return <div>Run ID: {run.id}</div>;
-  }
+  if (run) {
+    return <div>Run ID: {run.id}</div>;
+  }
+
+  if (handle) {
+    return <div>Run ID: {handle.id}</div>;
+  }
🧹 Nitpick comments (15)
docs/realtime/react-hooks/triggering.mdx (1)

189-189: Drop the stray {" "}

The added JSX fragment renders an unnecessary space and clutters the markup.

-<RealtimeExamplesCards />{" "}
+<RealtimeExamplesCards />
docs/realtime/react-hooks/swr.mdx (1)

36-44: Add 'use client'; to the typed example for consistency

The first example includes the directive but the typed version does not. Including it avoids confusion for readers using the Next.js App Router.

+"use client";
 import { useRun } from "@trigger.dev/react-hooks";
 import type { myTask } from "@/trigger/myTask";
docs/realtime/react-hooks/overview.mdx (1)

25-27: Correct Yarn install command

yarn add is the canonical way to add a dependency; yarn install installs all existing deps.

-```bash yarn
-yarn install @trigger.dev/react-hooks
+```bash yarn
+yarn add @trigger.dev/react-hooks
docs/realtime/backend/subscribe.mdx (1)

31-37: Show a clean exit strategy for infinite iterators

subscribeToRunsWithTag never completes, but the example omits a break mechanism. Demonstrating an AbortController or manual break makes the pattern production-ready and prevents runaway loops.

docs/realtime/backend/metadata.mdx (2)

11-15: Broken anchor in link – update target path

/realtime/react-hooks/realtime#using-metadata doesn’t exist after the restructure (the page was renamed to /realtime/react-hooks/realtime and the heading became ## Using metadata). Either drop the #using-metadata fragment or confirm the section id still resolves.


222-223: Extraneous JSX fragment

{" "} after the RealtimeExamplesCards component renders an empty text node and is unnecessary.

-<RealtimeExamplesCards />{" "}
+<RealtimeExamplesCards />
docs/realtime/run-object.mdx (1)

55-60: Typo in enum description

it's maxDurationits maxDuration.

-| `TIMED_OUT`          | Run has reached it's maxDuration and has been stopped                                                     |
+| `TIMED_OUT`          | Run has reached its maxDuration and has been stopped                                                     |
docs/realtime/react-hooks/streams.mdx (1)

225-226: Superfluous spacing node

Same JSX fragment issue as in the backend metadata doc.

-<RealtimeExamplesCards />{" "}
+<RealtimeExamplesCards />
docs/realtime/overview.mdx (1)

9-10: Minor grammar fix

allows you subscribe to runsallows you to subscribe to runs.

-Trigger.dev Realtime allows you subscribe to runs and get real-time updates as they execute.
+Trigger.dev Realtime allows you to subscribe to runs and get real-time updates as they execute.
docs/realtime/how-it-works.mdx (2)

47-66: Clarify generic-union syntax to avoid TypeScript parsing edge-cases

The union passed to subscribeToRunsWithTag is technically valid but can confuse the TS parser or ESLint rules because the | has very low precedence inside a type argument list. Adding parentheses improves readability and eliminates any ambiguity.

-for await (const run of runs.subscribeToRunsWithTag<typeof myTask | typeof myOtherTask>("my-tag")) {
+for await (const run of runs.subscribeToRunsWithTag<(typeof myTask | typeof myOtherTask)>("my-tag")) {

89-92: Nit: tighten wording of the known-issue disclaimer

“are stored in object store” → “are stored in object storage” reads more naturally.

-... that has a large payload or large output and are stored in object store instead of the database.
+... that has a large payload or output stored in object storage instead of the database.
docs/realtime/react-hooks/realtime.mdx (2)

180-184: Grammar fix – drop the extra article

-The `useRealtimeBatch` hook allows you to subscribe to a batch of runs by its the batch ID.
+The `useRealtimeBatch` hook allows you to subscribe to a batch of runs by its batch ID.

598-604: Minor readability improvement

There is a stray leading space after <RealtimeExamplesCards /> causing {" "} to be rendered in MDX/JSX output. Removing it avoids an empty text node.

-<RealtimeExamplesCards />{" "}
+<RealtimeExamplesCards />
docs/realtime/auth.mdx (1)

18-34: Call out security best-practice for “no-scope” token example

The first example creates a token with zero scopes. Consider adding a one-line warning so readers do not mistakenly ship a useless (or worse, later broadened) token to production.

-const publicToken = await auth.createPublicToken(); // 👈 this public access token has no permissions, so is pretty useless!
+// ⚠️ Creates a token with **no** permissions – useful only for demonstration.
+const publicToken = await auth.createPublicToken();
docs/realtime/backend/streams.mdx (1)

124-129: Node-compatibility footnote for TextDecoderStream

TextDecoderStream is available only in Node ≥ 20 or in browsers. If users run tasks on older Node versions they will hit a runtime ReferenceError. A short note here (or in prerequisites) will prevent surprises.

Suggestion:

> **Note**  
> `TextDecoderStream` requires Node 20+ or a global polyfill when running in earlier environments.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d136a3 and d60cfaf.

📒 Files selected for processing (20)
  • docs/docs.json (2 hunks)
  • docs/frontend/react-hooks/overview.mdx (0 hunks)
  • docs/frontend/react-hooks/realtime.mdx (0 hunks)
  • docs/realtime/auth.mdx (3 hunks)
  • docs/realtime/backend/metadata.mdx (1 hunks)
  • docs/realtime/backend/overview.mdx (1 hunks)
  • docs/realtime/backend/streams.mdx (13 hunks)
  • docs/realtime/backend/subscribe.mdx (1 hunks)
  • docs/realtime/how-it-works.mdx (1 hunks)
  • docs/realtime/overview.mdx (1 hunks)
  • docs/realtime/react-hooks.mdx (0 hunks)
  • docs/realtime/react-hooks/overview.mdx (1 hunks)
  • docs/realtime/react-hooks/realtime.mdx (1 hunks)
  • docs/realtime/react-hooks/streams.mdx (1 hunks)
  • docs/realtime/react-hooks/swr.mdx (1 hunks)
  • docs/realtime/react-hooks/triggering.mdx (2 hunks)
  • docs/realtime/run-object.mdx (1 hunks)
  • docs/realtime/subscribe-to-batch.mdx (0 hunks)
  • docs/realtime/subscribe-to-run.mdx (0 hunks)
  • docs/realtime/subscribe-to-runs-with-tag.mdx (0 hunks)
💤 Files with no reviewable changes (6)
  • docs/realtime/react-hooks.mdx
  • docs/realtime/subscribe-to-runs-with-tag.mdx
  • docs/realtime/subscribe-to-run.mdx
  • docs/realtime/subscribe-to-batch.mdx
  • docs/frontend/react-hooks/realtime.mdx
  • docs/frontend/react-hooks/overview.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
docs/realtime/react-hooks/triggering.mdx (1)

65-65: Verify that the anchor slug actually resolves

#userealtimerun may not match the slug generated by Docusaurus/MDX (typically lower-case words separated by dashes, i.e. #use-realtime-run). A broken link here will silently 404.

docs/realtime/backend/overview.mdx (1)

47-58: Double-check SDK call metadata.stream

The snippet uses metadata.stream("openai", openaiCompletion), but the public v3 SDK examples usually expose streaming through streams.* helpers, not metadata. If metadata.stream is indeed correct, ignore this; otherwise update to avoid confusing readers.

docs/docs.json (1)

575-581: Redirect may point to an auth overview rather than to the React-hooks landing

"/frontend/overview" is redirected to "/realtime/auth".
If the intent was to send users to the new Realtime landing page, use "/realtime/overview" instead; otherwise verify the old page really belonged to authentication docs.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
docs/realtime/auth.mdx (4)

2-4: Unify “Realtime” vs “Real-time” terminology

Across the docs we switch between “Realtime” (no hyphen) and “real-time” (hyphenated). Pick one spelling and stick to it in titles, sidebar entries, and body copy to avoid confusing users and to keep navigation search-friendly.


13-17: Wrap top-level await in an async context

The snippet uses await at module top level, which only works in ESM contexts and can throw readers off. Wrapping the call in an async IIFE makes the example copy-paste-safe in both CJS and ESM projects.

-import { auth } from "@trigger.dev/sdk/v3";
-
-const publicToken = await auth.createPublicToken();
+import { auth } from "@trigger.dev/sdk/v3";
+
+(async () => {
+  const publicToken = await auth.createPublicToken();
+  // …
+})();

106-123: Minor grammar + possessive fix

Line 108: “Public Access Token's expire” → “Public Access Tokens expire”.
While touching this paragraph, consider trimming the long sentence that enumerates jose units into a bullet list for easier scanning.


221-225: Call out Node version requirement for for await…of

for await…of on an async iterator requires Node 10+ and an ES2018 target. Adding a short note (“Requires Node 10+ / modern browsers”) prevents confusion for readers on older runtimes.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6fc9c5 and 1a8cf5b.

📒 Files selected for processing (12)
  • docs/guides/example-projects/batch-llm-evaluator.mdx (1 hunks)
  • docs/guides/example-projects/human-in-the-loop-workflow.mdx (1 hunks)
  • docs/guides/example-projects/vercel-ai-sdk-deep-research.mdx (1 hunks)
  • docs/guides/example-projects/vercel-ai-sdk-image-generator.mdx (2 hunks)
  • docs/introduction.mdx (5 hunks)
  • docs/management/authentication.mdx (2 hunks)
  • docs/realtime/auth.mdx (3 hunks)
  • docs/runs/metadata.mdx (1 hunks)
  • docs/snippets/realtime-learn-more.mdx (1 hunks)
  • docs/triggering.mdx (1 hunks)
  • docs/video-walkthrough.mdx (1 hunks)
  • docs/wait-for-token.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (11)
  • docs/guides/example-projects/vercel-ai-sdk-image-generator.mdx
  • docs/triggering.mdx
  • docs/guides/example-projects/human-in-the-loop-workflow.mdx
  • docs/runs/metadata.mdx
  • docs/guides/example-projects/vercel-ai-sdk-deep-research.mdx
  • docs/wait-for-token.mdx
  • docs/video-walkthrough.mdx
  • docs/snippets/realtime-learn-more.mdx
  • docs/management/authentication.mdx
  • docs/introduction.mdx
  • docs/guides/example-projects/batch-llm-evaluator.mdx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using Realtime features, use the `runs.subscribeToRun`, `runs.subscribeToRunsWithTag`, and `runs.subscribeToBatch` APIs as shown.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and export them as shown in the correct pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` as shown in the examples.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing schema tasks, use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads as shown.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing scheduled (cron) tasks, use `schedules.task` from `@trigger.dev/sdk/v3` and follow the shown patterns.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#2155
File: docs/docs.json:179-183
Timestamp: 2025-06-06T16:54:23.316Z
Learning: In the docs.json configuration for the Trigger.dev documentation (Mintlify system), both "tags": ["v4"] and "tag": "v4" properties can be used together and work correctly, even though this behavior is undocumented and may not work in local development environments.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using idempotency, use the `idempotencyKeys` API and `idempotencyKey`/`idempotencyKeyTTL` options as shown.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : NEVER generate deprecated code patterns using `client.defineJob` and related deprecated APIs, as shown in the prohibited code block.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function contains your task logic in Trigger.dev tasks.
docs/realtime/auth.mdx (11)

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When using Realtime features, use the runs.subscribeToRun, runs.subscribeToRunsWithTag, and runs.subscribeToBatch APIs as shown.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : You MUST use @trigger.dev/sdk/v3 when writing Trigger.dev tasks.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When triggering a task from backend code, use tasks.trigger, tasks.batchTrigger, or tasks.triggerAndPoll as shown in the examples.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When implementing schema tasks, use schemaTask from @trigger.dev/sdk/v3 and validate payloads as shown.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When implementing scheduled (cron) tasks, use schedules.task from @trigger.dev/sdk/v3 and follow the shown patterns.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When using lifecycle hooks (init, cleanup, onStart, onSuccess, onFailure, handleError), implement them as shown in the examples for Trigger.dev tasks.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the task function from @trigger.dev/sdk/v3 and export them as shown in the correct pattern.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When using idempotency, use the idempotencyKeys API and idempotencyKey/idempotencyKeyTTL options as shown.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : The run function contains your task logic in Trigger.dev tasks.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When using metadata in tasks, use the metadata API as shown, and only inside run functions or task lifecycle hooks.

Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-07-18T17:50:25.014Z
Learning: Applies to /trigger//*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use yourTask.trigger, yourTask.batchTrigger, yourTask.triggerAndWait, yourTask.batchTriggerAndWait, batch.triggerAndWait, batch.triggerByTask, or batch.triggerByTaskAndWait as shown.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
docs/realtime/auth.mdx (1)

139-152: Verify tasks.trigger parameter ordering

The example passes four positional arguments:

tasks.trigger("my-task", payload, { tags }, { publicAccessToken: {} })

Current SDK (@trigger.dev/sdk/v3) exposes tasks.trigger(taskId, payload, options?), where options already contains both tags and publicAccessToken. If that’s still the case, the snippet will not compile.

Please cross-check the live signature and update the example (or mention the breaking change) before publishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant