Skip to content

Commit 7b544d1

Browse files
authored
docs: add bot discovery endpoint to getting started guide (#4570)
### Description This PR adds documentation for the bot discovery endpoint to the Getting Started guide. The `/.well-known/agent-metadata.json` endpoint exposes a bot's identity metadata (username, display name, description, avatar) in a standardized format, allowing bot directories and discovery services to automatically index and display available bots. ### Changes - Added "Add Bot Discovery Endpoint" section to `packages/docs/build/bots/getting-started.mdx` - Positioned the new section after project initialization and before environment configuration - Included clear code example showing how to implement the endpoint in `src/index.ts` - Added explanation that this endpoint is required for bot discoverability ### Checklist - [x] Documentation updated where applicable - [x] Changes adhere to the repository's contribution guidelines - [N/A] Tests added where required (documentation-only change)
1 parent 4e66f90 commit 7b544d1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/docs/build/bots/getting-started.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ cd my-bot
6464
bun install
6565
```
6666

67+
### Add Bot Discovery Endpoint
68+
69+
Open `src/index.ts` and add this route after the `/webhook` route:
70+
71+
```ts
72+
// After your /webhook route
73+
app.get('/.well-known/agent-metadata.json', async (c) => {
74+
return c.json(await bot.getIdentityMetadata())
75+
})
76+
```
77+
78+
This endpoint is **required** for bot directories to discover and index your bot. After deploying your bot, go to the [developer dashboard](https://app.towns.com/developer/dashboard) and click the **Boost** button to submit your bot for indexing.
79+
6780
### Configure Environment
6881

6982
Copy the `.env.sample` file in your project root:

0 commit comments

Comments
 (0)