@devries-cameron20 / composio-1 / commits / db550b1ee
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

tiny fixes

Sushmithamallesh committed Nov 12, 2025 at 15:43 UTC db550b1eef2dc24137676281d560f13b87fbb144
3 files changed +20 -37
fern/pages/src/triggers/using-triggers.mdx
+5 -5
@@ -105,15 +105,15 @@ Below are examples of webhook handlers for FastAPI and Next.js applications:
105 <SnippetCode
106 src="fern/snippets/triggers/python/trigger-webhook.py"
107 title="Python (FastAPI)"
108 - startLine={36}
109 - endLine={49}
108 + startLine={34}
109 + endLine={47}
110 />
111
112 <SnippetCode
113 src="fern/snippets/triggers/typescript/trigger-webhook.ts"
114 title="TypeScript (Next.js)"
115 startLine={39}
116 - endLine={70}
116 + endLine={57}
117 />
118 </CodeGroup>
119
@@ -135,8 +135,8 @@ To enable verification:
135 <SnippetCode
136 src="fern/snippets/triggers/python/trigger-webhook.py"
137 title="Python"
138 - startLine={12}
139 - endLine={34}
138 + startLine={10}
139 + endLine={32}
140 />
141
142 <SnippetCode
fern/snippets/triggers/python/trigger-webhook.py
-2
@@ -7,8 +7,6 @@ import hashlib
7 import base64
8 import os
9
10 -app = FastAPI(title="Webhook Demo")
11 -
10 def verify_webhook_signature(request: Request, body: bytes) -> bool:
11 """Verify Composio webhook signature"""
12 webhook_signature = request.headers.get("webhook-signature")
fern/snippets/triggers/typescript/trigger-webhook.ts
+15 -30
@@ -37,36 +37,21 @@ function verifyWebhookSignature(
37 }
38
39 export default async function webhookHandler(req: NextApiRequest, res: NextApiResponse) {
40 - if (req.method !== 'POST') {
41 - return res.status(405).json({
42 - status: 'error',
43 - message: 'Method not allowed'
44 - });
40 + const payload = req.body;
41 +
42 + if (payload.type === 'github_star_added_event') {
43 + const event: TriggerEvent<GitHubStarEventData> = {
44 + type: payload.type,
45 + timestamp: payload.timestamp,
46 + data: payload.data
47 + };
48 +
49 + console.log(`Repository ${event.data.repository_name} starred by ${event.data.starred_by}`);
50 + // Add your business logic here
51 }
52
47 - try {
48 - const payload = req.body;
49 -
50 - if (payload.type === 'github_star_added_event') {
51 - const event: TriggerEvent<GitHubStarEventData> = {
52 - type: payload.type,
53 - timestamp: payload.timestamp,
54 - data: payload.data
55 - };
56 -
57 - console.log(`Repository ${event.data.repository_name} starred by ${event.data.starred_by}`);
58 - // Add your business logic here
59 - }
60 -
61 - res.status(200).json({
62 - status: 'success',
63 - message: 'Webhook processed'
64 - });
65 - } catch (error) {
66 - console.error('Error processing webhook:', error);
67 - res.status(500).json({
68 - status: 'error',
69 - message: 'Internal server error'
70 - });
71 - }
53 + res.status(200).json({
54 + status: 'success',
55 + message: 'Webhook processed'
56 + });
57 }