From e0d386989665b584f2ce789fa9f180f8dba4dd2b Mon Sep 17 00:00:00 2001
From: D-K-P <8297864+D-K-P@users.noreply.github.com>
Date: Tue, 9 Sep 2025 14:02:05 +0100
Subject: [PATCH 1/2] Added anchor browser example project
---
docs/docs.json | 1 +
.../anchor-browser-web-scraper.mdx | 124 ++++++++++++++++++
docs/guides/introduction.mdx | 1 +
3 files changed, 126 insertions(+)
create mode 100644 docs/guides/example-projects/anchor-browser-web-scraper.mdx
diff --git a/docs/docs.json b/docs/docs.json
index 5755a7b4dd..06b2bc3353 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -336,6 +336,7 @@
{
"group": "Example projects",
"pages": [
+ "guides/example-projects/anchor-browser-web-scraper",
"guides/example-projects/batch-llm-evaluator",
"guides/example-projects/claude-thinking-chatbot",
"guides/example-projects/human-in-the-loop-workflow",
diff --git a/docs/guides/example-projects/anchor-browser-web-scraper.mdx b/docs/guides/example-projects/anchor-browser-web-scraper.mdx
new file mode 100644
index 0000000000..14e112e0ed
--- /dev/null
+++ b/docs/guides/example-projects/anchor-browser-web-scraper.mdx
@@ -0,0 +1,124 @@
+---
+title: "Automated website monitoring with Anchor Browser"
+sidebarTitle: "Anchor Browser web scraper"
+description: "Automated web monitoring using Trigger.dev's task scheduling and Anchor Browser's AI-powered browser automation."
+---
+
+import WebScrapingWarning from "/snippets/web-scraping-warning.mdx";
+
+
+
+## Overview
+
+This example demonstrates automated web monitoring using Trigger.dev's task scheduling and Anchor Browser's AI-powered browser automation tools.
+
+The task runs daily at 5pm ET to find the cheapest Broadway tickets available for same-day shows.
+
+**How it works:**
+
+- Trigger.dev schedules and executes the monitoring task
+- Anchor Browser spins up a remote browser session with an AI agent
+- The AI agent uses computer vision and natural language processing to analyze the TDF website
+- AI agent returns the lowest-priced show with specific details: name, price, and showtime
+
+## Tech stack
+
+- **[Node.js](https://nodejs.org)** runtime environment (version 16 or higher)
+- **[Trigger.dev](https://trigger.dev)** for task scheduling and task orchestration
+- **[Anchor Browser](https://anchorbrowser.io/)** for AI-powered browser automation
+- **[Playwright](https://playwright.dev/)** for browser automation libraries (handled via external dependencies)
+
+## GitHub repo
+
+
+ Click here to view the full code for this project in our examples repository on GitHub. You can
+ fork it and use it as a starting point for your own project.
+
+
+## Relevant code
+
+### Broadway ticket monitor task
+
+This task runs daily at 5pm ET, in [src/trigger/broadway-monitor.ts](https://github.com/triggerdotdev/examples/tree/main/anchor-browser-web-scraper/src/trigger/broadway-monitor.ts):
+
+```ts
+import { schedules } from "@trigger.dev/sdk";
+import Anchorbrowser from "anchorbrowser";
+
+export const broadwayMonitor = schedules.task({
+ id: "broadway-ticket-monitor",
+ cron: "0 21 * * *",
+ run: async (payload, { ctx }) => {
+ const client = new Anchorbrowser({
+ apiKey: process.env.ANCHOR_BROWSER_API_KEY!,
+ });
+
+ let session;
+ try {
+ // Create explicit session to get live view URL
+ session = await client.sessions.create();
+ console.log(`Session ID: ${session.data.id}`);
+ console.log(`Live View URL: https://live.anchorbrowser.io?sessionId=${session.data.id}`);
+
+ const response = await client.tools.performWebTask({
+ sessionId: session.data.id,
+ url: "https://www.tdf.org/discount-ticket-programs/tkts-by-tdf/tkts-live/",
+ prompt: `Look for the "Broadway Shows" section on this page. Find the show with the absolute lowest starting price available right now and return the show name, current lowest price, and show time. Be very specific about the current price you see. Format as: Show: [name], Price: [exact current price], Time: [time]`,
+ });
+
+ console.log("Raw response:", response);
+
+ const result = response.data.result?.result || response.data.result || response.data;
+
+ if (result && typeof result === "string" && result.includes("Show:")) {
+ console.log(`🎠Best Broadway Deal Found!`);
+ console.log(result);
+
+ return {
+ success: true,
+ bestDeal: result,
+ liveViewUrl: `https://live.anchorbrowser.io?sessionId=${session.data.id}`,
+ };
+ } else {
+ console.log("No Broadway deals found today");
+ return { success: true, message: "No deals found" };
+ }
+ } finally {
+ if (session?.data?.id) {
+ try {
+ await client.sessions.delete(session.data.id);
+ } catch (cleanupError) {
+ console.warn("Failed to cleanup session:", cleanupError);
+ }
+ }
+ }
+ },
+});
+```
+
+### Build configuration
+
+Since Anchor Browser uses browser automation libraries (Playwright) under the hood, we need to configure Trigger.dev to handle these dependencies properly by excluding them from the build bundle in [trigger.config.ts](https://github.com/triggerdotdev/examples/tree/main/anchor-browser-web-scraper/trigger.config.ts):
+
+```ts
+import { defineConfig } from "@trigger.dev/sdk";
+
+export default defineConfig({
+ project: "proj_your_project_id_here", // Get from Trigger.dev dashboard
+ maxDuration: 3600, // 1 hour - plenty of time for web automation
+ dirs: ["./src/trigger"],
+ build: {
+ external: ["playwright-core", "playwright", "chromium-bidi"],
+ },
+});
+```
+
+## Learn more
+
+- View the [Anchor Browser docs](https://anchorbrowser.io/docs) to learn more about Anchor Browser's AI-powered browser automation tools.
+- Check out the source code for the [Anchor Browser web scraper repo](https://github.com/triggerdotdev/examples/tree/main/anchor-browser-web-scraper) on GitHub.
+- Browser our [example projects](/guides/introduction) to see how you can use Trigger.dev with other services.
diff --git a/docs/guides/introduction.mdx b/docs/guides/introduction.mdx
index 79afeee86a..9bf4695651 100644
--- a/docs/guides/introduction.mdx
+++ b/docs/guides/introduction.mdx
@@ -45,6 +45,7 @@ Example projects are full projects with example repos you can fork and use. Thes
| Example project | Description | Framework | GitHub |
| :-------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :-------- | :------------------------------------------------------------------------------------------------------------- |
+| [Anchor Browser web scraper](/guides/example-projects/anchor-browser-web-scraper) | Monitor a website and find the cheapest tickets for a show. | — | [View the repo](https://github.com/triggerdotdev/examples/tree/main/anchor-browser-web-scraper) |
| [Batch LLM Evaluator](/guides/example-projects/batch-llm-evaluator) | Evaluate multiple LLM models and stream the results to the frontend. | Next.js | [View the repo](https://github.com/triggerdotdev/examples/tree/main/batch-llm-evaluator) |
| [Claude thinking chatbot](/guides/example-projects/claude-thinking-chatbot) | Use Vercel's AI SDK and Anthropic's Claude 3.7 model to create a thinking chatbot. | Next.js | [View the repo](https://github.com/triggerdotdev/examples/tree/main/claude-thinking-chatbot) |
| [Human-in-the-loop workflow](/guides/example-projects/human-in-the-loop-workflow) | Create audio summaries of newspaper articles using a human-in-the-loop workflow built with ReactFlow and Trigger.dev waitpoint tokens. | Next.js | [View the repo](https://github.com/triggerdotdev/examples/tree/main/article-summary-workflow) |
From f6c0e272ec1bd92c401bd7d1b79d1f832a4535ef Mon Sep 17 00:00:00 2001
From: D-K-P <8297864+D-K-P@users.noreply.github.com>
Date: Tue, 9 Sep 2025 14:28:33 +0100
Subject: [PATCH 2/2] Updated node ver
---
docs/guides/example-projects/anchor-browser-web-scraper.mdx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/guides/example-projects/anchor-browser-web-scraper.mdx b/docs/guides/example-projects/anchor-browser-web-scraper.mdx
index 14e112e0ed..1bdd8b5d45 100644
--- a/docs/guides/example-projects/anchor-browser-web-scraper.mdx
+++ b/docs/guides/example-projects/anchor-browser-web-scraper.mdx
@@ -23,7 +23,7 @@ The task runs daily at 5pm ET to find the cheapest Broadway tickets available fo
## Tech stack
-- **[Node.js](https://nodejs.org)** runtime environment (version 16 or higher)
+- **[Node.js](https://nodejs.org)** runtime environment (version 18.2 or higher)
- **[Trigger.dev](https://trigger.dev)** for task scheduling and task orchestration
- **[Anchor Browser](https://anchorbrowser.io/)** for AI-powered browser automation
- **[Playwright](https://playwright.dev/)** for browser automation libraries (handled via external dependencies)