Skip to content

[docs]: add Convex integration documentation#1658

Open
shrey150 wants to merge 1 commit intomainfrom
shrey/docs-convex-integration
Open

[docs]: add Convex integration documentation#1658
shrey150 wants to merge 1 commit intomainfrom
shrey/docs-convex-integration

Conversation

@shrey150
Copy link
Contributor

@shrey150 shrey150 commented Feb 4, 2026

Summary

  • Add documentation for using Stagehand with Convex applications
  • Include installation, configuration, and usage examples for extract, act, observe, and agent APIs
  • Add Convex to the docs navigation under Integrations (v3 only)

Test plan

  • Verify docs build successfully
  • Check navigation shows Convex integration
  • Confirm redirect works for /integrations/convex/

🤖 Generated with Claude Code


Summary by cubic

Adds Convex integration docs for Stagehand with setup and usage examples (extract, act, observe, agent), and updates navigation with working redirects.

  • New Features
    • Added v3 pages: integrations/convex/introduction and integrations/convex/configuration.
    • Added “Convex” to the Integrations nav in docs.json.
    • Added redirect from /integrations/convex/* to /v3/integrations/convex/*.

Written for commit 5a02f52. Summary will update on new commits. Review in cubic

Add documentation for using Stagehand with Convex applications, including
installation, configuration, and usage examples for extract, act, observe,
and agent APIs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: 5a02f52

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant User as User/Client
    participant ConvexAction as Convex Action (Node.js)
    participant StagehandClient as Stagehand Client (convex-stagehand)
    participant ConvexComp as Convex Component (Bridge)
    participant Browserbase as Browserbase (Cloud Browser)
    participant LLM as LLM Provider (OpenAI/Anthropic)

    Note over User,LLM: NEW: Stagehand Convex Integration Flow

    User->>>ConvexAction: Trigger Action (e.g., extractProducts)
    
    ConvexAction->>>StagehandClient: NEW: new Stagehand(ctx, components.stagehand)
    Note right of ConvexAction: Uses BROWSERBASE_API_KEY<br/>& MODEL_API_KEY

    ConvexAction->>>StagehandClient: NEW: stagehand.extract / .act / .observe / .agent
    
    StagehandClient->>>ConvexComp: Proxy request with Zod schema/instructions
    
    ConvexComp->>>Browserbase: NEW: Create/Connect to Session
    activate Browserbase
    
    Browserbase->>>LLM: Send DOM snapshot + natural language instruction
    LLM-->>Browserbase: Return interaction logic / extracted JSON
    
    Browserbase->>>Browserbase: Execute browser steps (if .act or .agent)
    
    Browserbase-->>ConvexComp: Return execution result / data
    deactivate Browserbase
    
    ConvexComp-->>StagehandClient: Return structured response
    StagehandClient-->>ConvexAction: Return typed data (Zod validated)
    
    ConvexAction-->>User: Return API Response
    
    opt Session Management
        ConvexAction->>>StagehandClient: NEW: startSession()
        StagehandClient-->>ConvexAction: sessionId
        Note over ConvexAction,Browserbase: Reuse sessionId for multi-step persistence
        ConvexAction->>>StagehandClient: NEW: endSession()
    end
Loading

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Adds comprehensive documentation for integrating Stagehand with Convex applications. The PR includes two new documentation pages (introduction and configuration) and updates the navigation structure to include Convex under the Integrations section in v3.

Key changes:

  • Navigation configuration updated to include Convex integration pages
  • Added redirect rule for /integrations/convex/:slug* paths
  • Introduction page explains when to use Convex integration and the core API methods
  • Configuration page provides installation instructions and working examples for extract, act, observe, and agent APIs
  • Examples demonstrate session management and model configuration

Minor issue:

  • Zod import uses "zod" instead of the "zod/v3" pattern used throughout v3 docs

Confidence Score: 4/5

  • Safe to merge with minor style inconsistency that should be addressed
  • Documentation is well-structured and follows existing integration patterns. The only issue is a minor import inconsistency with Zod that doesn't affect functionality but should be aligned with v3 conventions for consistency.
  • Pay attention to packages/docs/v3/integrations/convex/configuration.mdx for the Zod import correction

Important Files Changed

Filename Overview
packages/docs/v3/integrations/convex/configuration.mdx Added configuration guide with installation instructions and usage examples; inconsistent Zod import compared to other v3 docs

Sequence Diagram

sequenceDiagram
    participant User
    participant ConvexAction
    participant StagehandClient
    participant BrowserbaseAPI
    participant LLM
    
    User->>ConvexAction: Trigger action (extract/act/observe/agent)
    ConvexAction->>StagehandClient: Initialize with components.stagehand
    StagehandClient->>BrowserbaseAPI: Start browser session
    BrowserbaseAPI-->>StagehandClient: Return sessionId
    
    alt Extract Data
        ConvexAction->>StagehandClient: extract(ctx, {url, instruction, schema})
        StagehandClient->>BrowserbaseAPI: Navigate to URL
        StagehandClient->>LLM: Analyze page + extract data
        LLM-->>StagehandClient: Structured data
        StagehandClient-->>ConvexAction: Return extracted data
    else Perform Action
        ConvexAction->>StagehandClient: act(ctx, {url, action})
        StagehandClient->>BrowserbaseAPI: Navigate to URL
        StagehandClient->>LLM: Interpret action instruction
        LLM-->>StagehandClient: Action plan
        StagehandClient->>BrowserbaseAPI: Execute browser action
        BrowserbaseAPI-->>StagehandClient: Action result
        StagehandClient-->>ConvexAction: Return result
    else Observe Elements
        ConvexAction->>StagehandClient: observe(ctx, {url, instruction})
        StagehandClient->>BrowserbaseAPI: Navigate to URL
        StagehandClient->>LLM: Identify elements
        LLM-->>StagehandClient: Available actions
        StagehandClient-->>ConvexAction: Return action list
    else Agent Workflow
        ConvexAction->>StagehandClient: agent(ctx, {url, instruction, options})
        StagehandClient->>BrowserbaseAPI: Start session
        loop Multi-step execution
            StagehandClient->>LLM: Plan next step
            LLM-->>StagehandClient: Action decision
            StagehandClient->>BrowserbaseAPI: Execute action
        end
        StagehandClient-->>ConvexAction: Return final result
    end
    
    ConvexAction-->>User: Return data/result
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

import { Stagehand } from "convex-stagehand";
import { components } from "./_generated/api";
import { action } from "./_generated/server";
import { z } from "zod";
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistent Zod import path. Most v3 documentation uses "zod/v3" instead of "zod".

Suggested change
import { z } from "zod";
import { z } from "zod/v3";

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/docs/v3/integrations/convex/configuration.mdx
Line: 62:62

Comment:
Inconsistent Zod import path. Most v3 documentation uses `"zod/v3"` instead of `"zod"`.

```suggestion
import { z } from "zod/v3";
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

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