Skip to content

Commit 0f3928f

Browse files
committed
Update webhooks-and-routes.mdx
1 parent 9eba720 commit 0f3928f

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

plugins/webhooks-and-routes.mdx

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,7 @@ ElizaOS provides two types of tests for validating webhook functionality: compon
459459

460460
Component tests verify route handler logic in isolation:
461461

462-
```typescript
463-
// src/__tests__/webhook-routes.test.ts
462+
```typescript src/__tests__/webhook-routes.test.ts
464463
import { describe, it, expect, beforeEach } from 'bun:test';
465464
import { webhookPlugin } from '../index';
466465

@@ -553,8 +552,7 @@ describe('Webhook Plugin Routes', () => {
553552

554553
E2E tests validate the complete webhook flow with a live agent runtime:
555554

556-
```typescript
557-
// src/__tests__/webhook-e2e.test.ts
555+
```typescript src/__tests__/webhook-e2e.test.ts
558556
import { TestSuite } from '@elizaos/core';
559557

560558
export const webhookE2ETests: TestSuite = {
@@ -656,8 +654,7 @@ export default webhookE2ETests;
656654

657655
Include tests in your plugin definition:
658656

659-
```typescript
660-
// src/index.ts
657+
```typescript src/index.ts
661658
import { webhookE2ETests } from './__tests__/webhook-e2e.test';
662659

663660
export const webhookPlugin: Plugin = {
@@ -686,33 +683,6 @@ elizaos test
686683
elizaos test --name "Webhook Integration"
687684
```
688685

689-
## Troubleshooting
690-
691-
### Common Issues
692-
693-
1. **Route not found**: Ensure your plugin is loaded and the path is correct
694-
2. **Authentication errors**: Check API keys and headers
695-
3. **Message not appearing**: Verify channel ID and agent permissions
696-
4. **Timeout errors**: Increase timeout or process asynchronously
697-
5. **CORS issues**: Configure CORS headers in your route handler
698-
699-
### Debug Logging
700-
701-
Enable debug logging in your route handlers:
702-
703-
```typescript
704-
handler: async (req, res, runtime) => {
705-
console.log('[Webhook] Received:', {
706-
method: req.method,
707-
path: req.path,
708-
headers: req.headers,
709-
body: req.body
710-
});
711-
712-
// ... handler logic ...
713-
}
714-
```
715-
716686
## See Also
717687

718688
<CardGroup cols={2}>
@@ -724,11 +694,11 @@ handler: async (req, res, runtime) => {
724694
Creating plugins
725695
</Card>
726696

727-
<Card title="API Reference: Messaging" icon="message-square" href="/api-reference/messaging">
728-
Messaging API endpoints
697+
<Card title="Sessions API" icon="messages" href="/runtime/sessions-api">
698+
Build persistent conversations on messaging
729699
</Card>
730700

731-
<Card title="Runtime Messaging" icon="zap" href="/runtime/messaging">
701+
<Card title="Runtime Messaging" icon="wifi" href="/runtime/messaging">
732702
Real-time messaging infrastructure
733703
</Card>
734704
</CardGroup>

0 commit comments

Comments
 (0)