docs/agents/custom-code-agent/quickstart.mdx
This guide covers creating a custom code agent in the dashboard, hooking up Slack, scaffolding the bridge app, and getting a reply in-thread.
By the end, you'll have a working agent that receives messages from Slack and replies based on your handler code.
Prerequisites:
<Prompt description="Add a Novu agent to my app" icon="plug" actions={["copy", "cursor"]}> Add an agent to my app following instructions from this markdown file: https://novu.co/agents.md
Follow my project's existing framework, routing, styling, and TypeScript conventions.
Reference: https://docs.novu.co/agents/custom-code-agent/quickstart </Prompt>
<Steps> <Step>Novu opens the guided setup page after creation.
</Step> <Step>The dashboard unlocks the Slack setup steps.
</Step> <Step>Novu can create the Slack app using a Slack App Configuration Token.
You'll receive a welcome message from the agent when installation completes.
</Step> <Step>Copy the scaffold command from the dashboard:
npx novu@latest init -t agent \
--secret-key=<NOVU_SECRET_KEY> \
--api-url=<NOVU_API_URL>
Run it in the directory where you want the project. See Scaffold your project for details.
</Step> <Step>npm run dev:novu
This starts your app, opens a dev tunnel, and registers the bridge URL. When connected, you'll see another message from your agent in Slack.
</Step> <Step>Message your bot in Slack. Your onMessage handler runs and the reply appears in the thread.
Edit files in app/novu/agents/ to customize behavior. See Handle events for all event types.