Skip to content

Commit 9911d82

Browse files
committed
Squashed commit of the following:
commit 1f9cc38a83e88bd9482ed2c29cf85990e3d17124 Author: D-K-P <[email protected]> Date: Fri Nov 14 12:02:30 2025 +0000 Updated examples and readme commit 70ebd4d9978ae39f6111c5b6d0421e87619e4c54 Author: D-K-P <[email protected]> Date: Wed Nov 12 15:46:16 2025 +0000 Added claude agent sdk to the main table commit 7fa32d34c9c168a588a43b9d893df0e53dde51e8 Author: D-K-P <[email protected]> Date: Wed Nov 12 15:43:42 2025 +0000 Renamed project, updated readme commit a833ce6959f64ac3974b88778a2c40be946812aa Author: D-K-P <[email protected]> Date: Wed Nov 12 15:40:31 2025 +0000 Updated the claude-code-sdk to the agent sdk and update files commit 31b465dfdbc36d78f07f29af76e286cec1317a36 Author: D-K-P <[email protected]> Date: Wed Nov 12 15:23:34 2025 +0000 Added claude code sdk basic exampleand updated packages
1 parent 8ad2819 commit 9911d82

File tree

11 files changed

+5614
-3
lines changed

11 files changed

+5614
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img alt="Trigger.dev logo" src="https://imagedelivery.net/3TbraffuDZ4aEf8KWOmI_w/a45d1fa2-0ae8-4a39-4409-f4f934bfae00/public">
66
</picture>
77

8-
[Discord](https://trigger.dev/discord) | [Website](https://trigger.dev) | [Docs](https://trigger.dev/docs) | [Guides](https://trigger.dev/docs/guides)
8+
[Trigger.dev GitHub repo](https://github.com/triggerdotdev/trigger.dev) | [Discord](https://trigger.dev/discord) | [Website](https://trigger.dev) | [Docs](https://trigger.dev/docs) | [Guides](https://trigger.dev/docs/guides)
99

1010
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev)
1111

@@ -19,15 +19,14 @@ This open source repo contains examples of full-stack and headless projects usin
1919

2020
For information on how to run each project, see the README in each directory.
2121

22-
> **ℹ️ Note:** If you want to upgrade from Trigger.dev v3 to v4, please refer to our [v4 upgrade guide](https://trigger.dev/docs/migrating-from-v3).
23-
2422
| Project | Description |
2523
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
2624
| [Anchor Browser web scraper](/anchor-browser-web-scraper) | Automated web monitoring using Trigger.dev's job scheduling and Anchor Browser's AI-powered browser automation tools. |
2725
| [Article summary workflow](/article-summary-workflow) | Create audio summaries of newspaper articles using a human-in-the-loop workflow with [ReactFlow](https://reactflow.dev/), [Trigger.dev Realtime](https://trigger.dev/docs/realtime/overview) and [waitpoints](https://trigger.dev/blog/v4-beta-launch#waitpoints) |
2826
| [Batch LLM evaluator](/batch-llm-evaluator) | Batch processing tool for evaluating LLM responses from a single prompt using Vercel's [AI SDK](https://sdk.vercel.ai/docs/introduction) and [Trigger.dev Realtime](https://trigger.dev/docs/realtime/overview) |
2927
| [Building effective agents](/building-effective-agents) | 5 different patterns for building effective AI agents with Trigger.dev; [Prompt chaining](/building-effective-agents/src/trigger/trigger/translate-copy.ts), [Routing](/building-effective-agents/src/trigger/trigger/routing-questions.ts), [Parallelization](/building-effective-agents/src/trigger/trigger/parallel-llm-calls.ts), [Orchestrator-workers](/building-effective-agents/src/trigger/trigger/orchestrator-workers.ts) |
3028
| [Claude thinking chatbot](/claude-thinking-chatbot) | A chatbot that uses Claude's thinking capabilities to generate responses |
29+
| [Claude agent SDK](/claude-agent-sdk-trigger) | A simple example of how to use the [Claude Agent SDK](https://docs.claude.com/en/docs/agent-sdk/overview) with Trigger.dev |
3130
| [Deep research agent using the AI SDK](/vercel-ai-sdk-deep-research-agent/) | An intelligent deep research agent using the Vercel [AI SDK](https://sdk.vercel.ai/docs/introduction) and Trigger.dev |
3231
| [Monorepos](/monorepos) | Examples of using Trigger.dev in monorepo setups with [Turborepo](https://turbo.build/) and [Prisma](https://www.prisma.io/) |
3332
| [Next.js server actions](/nextjs-server-actions) | A [Next.js app](https://nextjs.org/) that triggers Trigger.dev tasks using Server Actions |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TRIGGER_PROJECT_REF="<your trigger.dev project ref here, starts with proj_>"
2+
ANTHROPIC_API_KEY="sk-ant-api03-1234"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
CLAUDE.md
4+
5+
postgres-data
6+
# dependencies
7+
node_modules
8+
.pnp
9+
.pnp.js
10+
11+
# testing
12+
coverage
13+
14+
# next.js
15+
.next/
16+
out/
17+
dist
18+
packages/**/dist
19+
20+
# Tailwind
21+
apps/**/styles/tailwind.css
22+
packages/**/styles/tailwind.css
23+
24+
# misc
25+
.DS_Store
26+
*.pem
27+
28+
# debug
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
33+
# local env files
34+
.env.docker
35+
.docker/*.env
36+
.env.local
37+
.env.development.local
38+
.env.test.local
39+
.env.production.local
40+
41+
# turbo
42+
.turbo
43+
.vercel
44+
.cache
45+
.env
46+
.output
47+
apps/**/public/build
48+
.tests-container-id.txt
49+
.sentryclirc
50+
.buildt
51+
52+
**/tmp/
53+
/test-results/
54+
/playwright-report/
55+
/playwright/.cache/
56+
57+
.cosine
58+
.trigger
59+
.tshy*
60+
.yarn
61+
*.tsbuildinfo
62+
.claude

claude-agent-sdk-trigger/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.11.1

claude-agent-sdk-trigger/README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## Using Claude Agent SDK with Trigger.dev
2+
3+
This is a secure example of how to use the [Claude Agent SDK](https://docs.claude.com/en/docs/agent-sdk/overview) with [Trigger.dev](https://trigger.dev).
4+
5+
**Two example implementations:**
6+
7+
- `code.ts` - Basic safe code generation (recommended starting point)
8+
- `code-advanced.ts` - Advanced with bash execution and approval system
9+
10+
### Setup
11+
12+
Create a new project in Trigger.dev and copy the project ref.
13+
14+
```bash
15+
npm install
16+
```
17+
18+
Copy the `.env.example` file to `.env` and fill in the values:
19+
20+
```bash
21+
cp .env.example .env
22+
```
23+
24+
```bash
25+
TRIGGER_PROJECT_REF="<your trigger.dev project ref here, starts with proj_>"
26+
ANTHROPIC_API_KEY="sk-ant-api03-1234"
27+
```
28+
29+
The Claude Agent SDK will automatically use the `ANTHROPIC_API_KEY` environment variable for authentication. Model configuration and other settings are configured directly in the task code at `src/trigger/code.ts`.
30+
31+
Authenticate the `trigger.dev` CLI with your Trigger.dev account:
32+
33+
```bash
34+
npm run trigger:login
35+
```
36+
37+
### Run
38+
39+
Run the dev command to register your tasks and test/run them locally.
40+
41+
```bash
42+
npm run dev
43+
```
44+
45+
### View code
46+
47+
**Basic example** (`src/trigger/code.ts`):
48+
49+
- Safe code generation without bash execution
50+
- Isolated workspace with automatic cleanup
51+
- Permission mode: `acceptEdits` (auto-approves file operations)
52+
- Good for: generating code, analyzing files, data transformation
53+
54+
**Advanced example** (`src/trigger/code-advanced.ts`):
55+
56+
- Full development workflow with bash execution capability
57+
- Isolated workspace with automatic cleanup
58+
- Permission mode: `acceptEdits` (auto-approves file edits)
59+
- Bash tool enabled in allowedTools list
60+
- Good for: npm install, running tests, build commands
61+
- **Warning:** Only use with trusted users - enables command execution
62+
63+
### Test
64+
65+
You can trigger the `claude-code` task by sending a POST request:
66+
67+
```bash
68+
curl -X POST "https://api.trigger.dev/api/v1/tasks/claude-code/trigger" \
69+
-H "Content-Type: application/json" \
70+
-H "Authorization: Bearer <your trigger.dev DEVELOPMENT API key here, starts with tr_dev_>" \
71+
-d '{
72+
"payload": {
73+
"prompt": "Write a simple hello world program in JavaScript.",
74+
"maxTurns": 3,
75+
"maxIterations": 10
76+
},
77+
}'
78+
```
79+
80+
Or you could visit the Trigger.dev Dashboard and use the "Test" page to trigger the task
81+
82+
<img width="3680" height="2382" alt="CleanShot 2025-07-15 at 22 16 19@2x" src="https://github.com/user-attachments/assets/fe06c1dc-c49c-4cfb-89f7-bd8f69a77e90" />

0 commit comments

Comments
 (0)