Skip to content

fix convex docs#953

Merged
BilalG1 merged 5 commits intodevfrom
convex-fix-docs
Oct 17, 2025
Merged

fix convex docs#953
BilalG1 merged 5 commits intodevfrom
convex-fix-docs

Conversation

@BilalG1
Copy link
Contributor

@BilalG1 BilalG1 commented Oct 15, 2025

High-level PR Summary

This PR fixes a documentation error in the Convex integration guide by correcting two incorrect references from stackServerApp to stackClientApp for the getConvexClientAuth() method calls in browser and React environments. The HTTP client example correctly remains using stackClientApp as it was already accurate.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 docs/templates/others/convex.mdx

Need help? Join our Discord

Analyze latest changes


Important

Fixes incorrect method references in Convex integration docs to use stackClientApp for browser and React environments.

  • Documentation:
    • Corrects method references in convex.mdx and README.md from stackServerApp to stackClientApp for getConvexClientAuth() in browser and React environments.
    • Updates HTTP client example to use stackClientApp.getConvexHttpClientAuth() with tokenStore parameter.
    • Adds a link to a full example on GitHub in convex.mdx.

This description was created by Ellipsis for 2e9c3f0. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Documentation
    • Updated Convex authentication examples to use client-side setup for browser, React, and HTTP clients.
    • Revised example snippets and wording to reflect current client-oriented APIs for auth initialization.
    • Clarified how to supply a token store for HTTP usage and aligned examples with current best practices.

@vercel
Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
stack-backend Ready Ready Preview Comment Oct 17, 2025 11:40am
stack-dashboard Ready Ready Preview Comment Oct 17, 2025 11:40am
stack-demo Ready Ready Preview Comment Oct 17, 2025 11:40am
stack-docs Ready Ready Preview Comment Oct 17, 2025 11:40am

@BilalG1 BilalG1 marked this pull request as ready for review October 15, 2025 01:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Updated documentation examples to replace server-side stackServerApp calls with client-side stackClientApp equivalents and adjusted method names for configuring Convex browser, React, and HTTP clients.

Changes

Cohort / File(s) Summary
Docs: Convex client auth examples
docs/templates/others/convex.mdx
Replaced stackServerApp usages with stackClientApp and updated calls to getConvexClientAuth({}) and getConvexHttpClientAuth({ tokenStore }) for browser, React, and HTTP Convex client examples.
Package README: Convex integration examples
packages/template/src/integrations/convex/component/README.md
Updated example snippets: convexClient / convexReactClient now use stackClientApp.getConvexClientAuth({}); convexHttpClient now uses stackClientApp.getConvexHttpClientAuth({ tokenStore }).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Init stack more args #892 — Adjusted docs/examples to use split client/server Stack entry points and client-side APIs (replacing stackServerApp usages with stackClientApp).

Poem

I twitch my whiskers, docs neatly shod,
Client-side footsteps replace the old nod.
Methods hop in, examples aligned,
I nibble a carrot, content and kind. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “fix convex docs” succinctly and accurately describes the main change of correcting the Convex integration documentation without unnecessary detail. It clearly communicates the primary intent of the pull request to teammates scanning the history.
Description Check ✅ Passed The pull request description includes the required CONTRIBUTING.md guideline comment, delivers a clear high-level summary of the documentation corrections, and details the specific method reference updates, meeting the repository’s description template requirements.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch convex-fix-docs

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afa6e5a and 2e9c3f0.

📒 Files selected for processing (1)
  • docs/templates/others/convex.mdx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/templates/others/convex.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). (10)
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: check_prisma_migrations (22.x)
  • GitHub Check: docker
  • GitHub Check: build (22.x)
  • GitHub Check: restart-dev-and-test
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: setup-tests
  • GitHub Check: all-good
  • GitHub Check: Security Check

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Oct 15, 2025

Claude finished @BilalG1's task —— View job


I'll analyze this and get back to you.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on 6b08d8b..6b2f9da

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

docs/templates/others/convex.mdx

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b08d8b and 6b2f9da.

📒 Files selected for processing (1)
  • docs/templates/others/convex.mdx (1 hunks)
⏰ 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). (11)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: docker
  • GitHub Check: restart-dev-and-test
  • GitHub Check: setup-tests
  • GitHub Check: build (22.x)
  • GitHub Check: check_prisma_migrations (22.x)
  • GitHub Check: docker
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: build (22.x)
  • GitHub Check: all-good
  • GitHub Check: Security Check

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

♻️ Duplicate comments (1)
docs/templates/others/convex.mdx (1)

55-55: Re-check HTTP snippet: likely needs server app (request-backed token store).

If convexHttpClient is used server-side, prefer the server app so it can read cookies/session via the request-bound token store. If the guide targets a non-server context with an explicit token store, current line is acceptable. Please confirm. Similar to earlier feedback; updating method name to the current API.

Suggested server-side variant:

-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject }));  // HTTP, see Stack Auth docs for more information on tokenStore
+convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject }));  // HTTP (server), tokenStore built from the request

To ensure consistency across the repo and surface of truth in templates, run:

#!/bin/bash
set -euo pipefail

echo "Audit Convex docs/templates for HTTP auth call:"
rg -n -C2 'convexHttpClient\.setAuth\(' docs templates packages || true

echo "Confirm there are no remaining uses of getAuthForConvexHttpClient:"
rg -n -C2 'getAuthForConvexHttpClient' || true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2f9da and afa6e5a.

📒 Files selected for processing (2)
  • docs/templates/others/convex.mdx (1 hunks)
  • packages/template/src/integrations/convex/component/README.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/template/**

📄 CodeRabbit inference engine (AGENTS.md)

When modifying the SDK copies, make changes in packages/template (source of truth)

Files:

  • packages/template/src/integrations/convex/component/README.md
⏰ 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). (11)
  • GitHub Check: setup-tests
  • GitHub Check: restart-dev-and-test
  • GitHub Check: all-good
  • GitHub Check: Vercel Agent Review
  • GitHub Check: lint_and_build (latest)
  • GitHub Check: build (22.x)
  • GitHub Check: check_prisma_migrations (22.x)
  • GitHub Check: build (22.x)
  • GitHub Check: docker
  • GitHub Check: docker
  • GitHub Check: Security Check
🔇 Additional comments (2)
packages/template/src/integrations/convex/component/README.md (1)

34-35: Correct: use client app for browser/React.

These two lines are right; getConvexClientAuth should come from stackClientApp in browser and React.

docs/templates/others/convex.mdx (1)

53-54: Correct: use client app for browser/React.

Good fix; getConvexClientAuth should be called on stackClientApp here.

convexHttpClient.setAuth(stackServerApp.getAuthForConvexHttpClient({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore
convexClient.setAuth(stackClientApp.getConvexClientAuth({})); // browser JS
convexReactClient.setAuth(stackClientApp.getConvexClientAuth({})); // React
convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Confirm HTTP context: client vs server app for Convex HTTP.

If convexHttpClient runs on the server and needs a request-backed token store, you likely want the server app variant. If it’s intentionally used in a client-like environment with an explicit token store, current line is fine. Please verify.

Suggested server-side alternative (note updated method name):

-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject }));  // HTTP, see Stack Auth docs for more information on tokenStore
+convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject }));  // HTTP (server), tokenStore built from the request

Run to verify API surface and find stale references:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Check where getConvexHttpClientAuth is defined/used:"
rg -n -C2 --type=ts 'getConvexHttpClientAuth\s*\(' || true

echo "Check whether both client and server apps expose it (interfaces/classes):"
rg -n -C3 --type=ts 'interface .*Client.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'interface .*Server.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'class .*Client.*\{[^}]*getConvexHttpClientAuth' || true
rg -n -C3 --type=ts 'class .*Server.*\{[^}]*getConvexHttpClientAuth' || true

echo "Find any stale method name:"
rg -n -C2 'getAuthForConvexHttpClient' || true

Length of output: 1829


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files under packages/template/src/lib/stack-app/apps:"
find packages/template/src/lib/stack-app/apps -type f

Length of output: 660


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Inspect server-app interface for getConvex methods:"
rg -n --type=ts 'getConvex' -C3 packages/template/src/lib/stack-app/apps/interfaces/server-app.ts || true

echo "Inspect server-app implementation for getConvex methods:"
rg -n --type=ts 'getConvex' -C3 packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts || true

Length of output: 108


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== server-app interface ==="
sed -n '1,200p' packages/template/src/lib/stack-app/apps/interfaces/server-app.ts

echo "=== server-app implementation ==="
sed -n '1,200p' packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts

Length of output: 17420


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== README context lines 1-100 ==="
sed -n '1,100p' packages/template/src/integrations/convex/component/README.md || true

Length of output: 2075


Use StackServerApp for HTTP auth

Replace the client-app call with the server-app variant so you generate tokens with your secret key:

-convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject }));
+convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject }));
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
convexHttpClient.setAuth(stackClientApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore
convexHttpClient.setAuth(stackServerApp.getConvexHttpClientAuth({ tokenStore: requestObject })); // HTTP, see Stack Auth docs for more information on tokenStore
🤖 Prompt for AI Agents
packages/template/src/integrations/convex/component/README.md around line 36:
the example uses the client-app method to set HTTP auth which does not generate
tokens with the server secret; replace the call to use the server-app variant
(StackServerApp) so tokens are created with your secret key by invoking the
server-app getConvexHttpClientAuth and passing the same
tokenStore/requestObject.

@BilalG1 BilalG1 merged commit b677e3f into dev Oct 17, 2025
19 checks passed
@BilalG1 BilalG1 deleted the convex-fix-docs branch October 17, 2025 17:29
@coderabbitai coderabbitai bot mentioned this pull request Nov 25, 2025
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.

2 participants