{"id":50342521,"url":"https://github.com/BitteProtocol/agent-next-boilerplate","last_synced_at":"2026-06-15T09:01:04.960Z","repository":{"id":258413265,"uuid":"873881961","full_name":"BitteProtocol/agent-next-boilerplate","owner":"BitteProtocol","description":"NextJS Boilerplate for Bitte Open Agents","archived":false,"fork":false,"pushed_at":"2025-07-23T13:39:59.000Z","size":3117,"stargazers_count":15,"open_issues_count":1,"forks_count":26,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-26T18:25:51.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://agent-next-boilerplate.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BitteProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-16T22:07:44.000Z","updated_at":"2026-03-26T13:45:44.000Z","dependencies_parsed_at":"2024-11-19T13:40:01.858Z","dependency_job_id":"7acb95a7-b73f-4de7-b66a-7583c37967c0","html_url":"https://github.com/BitteProtocol/agent-next-boilerplate","commit_stats":null,"previous_names":["bitteprotocol/agent-next-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BitteProtocol/agent-next-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fagent-next-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fagent-next-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fagent-next-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fagent-next-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BitteProtocol","download_url":"https://codeload.github.com/BitteProtocol/agent-next-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fagent-next-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34355156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-29T18:00:25.258Z","updated_at":"2026-06-15T09:01:04.941Z","avatar_url":"https://github.com/BitteProtocol.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Bitte AI Agent NextJS Boilerplate\n\nA comprehensive template for creating AI agents using the Bitte Protocol with Next.js. This boilerplate demonstrates best practices for building blockchain-enabled AI agents with pre-configured tools and endpoints.\n\n## 🌟 Features\n\n- 🤖 **Complete AI Agent Setup** - Pre-configured agent manifest with OpenAPI specification\n- 🔗 **Blockchain Integration** - Built-in support for NEAR and EVM transactions\n- 🛠️ **Ready-to-Use Tools**:\n  - Blockchain information retrieval\n  - NEAR \u0026 EVM transaction generation with wallet integration\n  - Ethereum message signing (eth_sign, personal_sign, typed data)\n  - User account \u0026 EVM address retrieval\n  - Twitter share intent generation\n  - Coin flip functionality\n- ⚡ **Next.js 15** with App Router and TypeScript\n- 🎨 **Modern Development Stack** - Tailwind CSS, ESLint, TypeScript\n- 🚀 **One-Command Development** - Integrated with `make-agent` for seamless development\n- 📋 **Production Ready** - Built-in deployment scripts and Vercel integration\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+ and pnpm\n- A Bitte wallet account\n- Git\n\n### 1. Clone and Setup\n\n```bash\ngit clone https://github.com/BitteProtocol/agent-next-boilerplate.git\ncd agent-next-boilerplate\npnpm install\n```\n\n### 2. Environment Configuration\n\nCreate a `.env.local` file:\n\n```bash\n# Required: Get your API key from https://key.bitte.ai\nBITTE_API_KEY='your-api-key'\n\n# Required: Your NEAR account ID (e.g., yourname.near)\nACCOUNT_ID='your-account.near'\n\n# Optional: For local development\nNEXT_PUBLIC_HOST='localhost'\nPORT=3000\n```\n\n### 3. Start Development\n\n```bash\npnpm run dev\n```\n\nThis command will:\n- Start your Next.js application on `http://localhost:3000`\n- Launch `make-agent` development mode\n- Prompt you to sign a message in your Bitte wallet to authenticate\n- Open your agent in the Bitte playground for testing\n- Enable hot reload for seamless development\n\n### 4. Build for Production\n\n```bash\n# Build without deployment\npnpm run build\n\n# Build and deploy to production\npnpm run build:deploy\n```\n\n## 🔧 Available Tools\n\nThe boilerplate includes six fully functional tools that demonstrate different agent capabilities:\n\n### 1. **Blockchain Information** (`/api/tools/get-blockchains`)\n- **Purpose**: Returns a randomized list of 3 blockchain networks\n- **Implementation**: Static list with random selection\n- **Use Case**: Demonstrating simple data retrieval and randomization\n\n### 2. **NEAR Transaction Generator** (`/api/tools/create-near-transaction`)\n- **Purpose**: Creates NEAR transaction payloads for token transfers\n- **Parameters**: `receiverId` (NEAR account), `amount` (NEAR tokens)\n- **Implementation**: Converts amounts to yoctoNEAR (10^24) for precision\n- **Integration**: Works with Bitte's `generate-transaction` tool for wallet execution\n\n### 3. **EVM Transaction Generator** (`/api/tools/create-evm-transaction`)\n- **Purpose**: Creates EVM transaction payloads for ETH transfers\n- **Parameters**: `to` (recipient address), `amount` (ETH amount)\n- **Implementation**: Uses viem for proper ETH amount parsing\n- **Integration**: Works with Bitte's `generate-evm-tx` tool for wallet execution\n\n### 4. **Ethereum Message Signing** (`/api/tools/eth-sign-request`)\n- **Purpose**: Creates various Ethereum signature requests\n- **Methods**: `eth_sign`, `personal_sign`, `eth_signTypedData`, `eth_signTypedData_v4`\n- **Parameters**: `evmAddress`, `chainId`, `method`, `message`\n- **Implementation**: Supports both simple messages and typed data structures\n\n### 5. **User Information** (`/api/tools/get-user`)\n- **Purpose**: Returns user's NEAR account ID and EVM address\n- **Context-Aware**: Automatically populated by Bitte's context system\n- **Use Case**: Accessing authenticated user information within agent flows\n\n### 6. **Twitter Integration** (`/api/tools/twitter`)\n- **Purpose**: Generates Twitter share intent URLs\n- **Parameters**: `text` (required), `url`, `hashtags`, `via`\n- **Implementation**: Proper URL encoding for all parameters\n- **Use Case**: Social sharing and engagement features\n\n### 7. **Coin Flip** (`/api/tools/coinflip`)\n- **Purpose**: Simple randomization tool returning \"heads\" or \"tails\"\n- **Implementation**: Cryptographically random using Math.random()\n- **Use Case**: Demonstrating simple random functionality\n\n## 🤖 Agent Configuration\n\nThe agent is configured through the AI plugin manifest at `/api/ai-plugin/route.ts`. This endpoint returns an OpenAPI specification that defines:\n\n### Agent Metadata\n```typescript\n{\n  name: \"Blockchain Assistant\",\n  description: \"An assistant that answers with blockchain information...\",\n  instructions: \"You create near and evm transactions, give blockchain information...\",\n  tools: [\n    { type: \"generate-transaction\" },  // NEAR transactions\n    { type: \"generate-evm-tx\" },       // EVM transactions\n    { type: \"sign-message\" }           // Message signing\n  ],\n  categories: [\"DeFi\", \"DAO\", \"Social\"],\n  chainIds: [1, 8453]  // Ethereum Mainnet, Base\n}\n```\n\n### Important Configuration Notes\n\n1. **Tool Integration**: The agent uses Bitte's built-in tools (`generate-transaction`, `generate-evm-tx`, `sign-message`) to execute blockchain operations\n2. **Two-Step Process**: Your endpoints generate transaction payloads, then Bitte's tools execute them in the user's wallet\n3. **Chain Support**: Currently configured for Ethereum Mainnet (1) and Base (8453)\n4. **Deployment URL**: Automatically detected from Vercel or environment variables\n\n## 📝 Environment Variables\n\n| Variable | Required | Description | Example |\n|----------|----------|-------------|---------|\n| `BITTE_API_KEY` | ✅ | Your Bitte API key from [key.bitte.ai](https://key.bitte.ai) | `bitte_key_...` |\n| `ACCOUNT_ID` | ✅ | Your blockchain account ID | `walletaddresss` |\n| `NEXT_PUBLIC_HOST` | ❌ | Development host | `localhost` |\n| `PORT` | ❌ | Development port | `3000` |\n| `NEXT_PUBLIC_BASE_URL` | ❌ | Base URL for assets | `https://yourdomain.com` |\n\n## 🛠️ Development Scripts\n\n```bash\n# Development with hot reload and make-agent\npnpm run dev\n\n# Next.js development only (without make-agent)\npnpm run dev:agent\n\n# Production build (local)\npnpm run build\n\n# Build and deploy to production\npnpm run build:deploy\n\n# Linting\npnpm run lint\n```\n\n## 🚀 Deployment\n\n### Automatic Deployment (Recommended)\n\n1. Push your code to GitHub\n2. Connect your repository to [Vercel](https://vercel.com)\n3. Add environment variables in Vercel dashboard:\n   - `BITTE_API_KEY`\n   - `ACCOUNT_ID`\n4. Deploy! The build process automatically runs `make-agent deploy`\n\n### Manual Deployment\n\n```bash\n# Build and deploy manually\npnpm run build:deploy\n```\n\n## 🔨 Creating Custom Tools\n\nTo add your own tools to the agent:\n\n### 1. Create the Tool Endpoint\n\n```typescript\n// src/app/api/tools/my-tool/route.ts\nimport { NextResponse } from 'next/server';\n\nexport async function GET(request: Request) {\n  const { searchParams } = new URL(request.url);\n  const param = searchParams.get('param');\n\n  // Your tool logic here\n\n  return NextResponse.json({ result: 'success' });\n}\n```\n\n### 2. Add to Agent Manifest\n\nUpdate `/api/ai-plugin/route.ts`:\n\n```typescript\npaths: {\n  // ... existing paths\n  \"/api/tools/my-tool\": {\n    get: {\n      summary: \"My custom tool\",\n      description: \"Description of what your tool does\",\n      operationId: \"my-tool\",\n      parameters: [\n        {\n          name: \"param\",\n          in: \"query\",\n          required: true,\n          schema: { type: \"string\" }\n        }\n      ],\n      responses: {\n        \"200\": {\n          description: \"Successful response\",\n          content: {\n            \"application/json\": {\n              schema: {\n                type: \"object\",\n                properties: {\n                  result: { type: \"string\" }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n### 3. Update Agent Instructions\n\nModify the `instructions` field in the agent configuration to include guidance on when and how to use your new tool.\n\n## 📖 Key Dependencies\n\n- **[@bitte-ai/agent-sdk](https://www.npmjs.com/package/@bitte-ai/agent-sdk)** - Core SDK for Bitte integration\n- **[make-agent](https://www.npmjs.com/package/make-agent)** - Development and deployment tooling\n- **[viem](https://viem.sh)** - TypeScript Ethereum library for transaction handling\n- **[Next.js 15](https://nextjs.org)** - React framework with App Router\n- **[vercel-url](https://www.npmjs.com/package/vercel-url)** - Automatic deployment URL detection\n\n## 🌐 Community \u0026 Support\n\n- 📚 [Bitte Protocol Documentation](https://docs.bitte.ai)\n- 💬 [Join our Telegram](https://t.me/bitteai) - Get help and connect with other developers\n- 🐛 [Report Issues](https://github.com/BitteProtocol/agent-next-boilerplate/issues)\n- 🔗 [Next.js Documentation](https://nextjs.org/docs)\n- 📋 [OpenAPI Specification](https://swagger.io/specification/)\n\n## 📋 Project Structure\n\n```\nagent-next-boilerplate/\n├── src/app/\n│   ├── api/\n│   │   ├── ai-plugin/route.ts      # Agent manifest endpoint\n│   │   └── tools/                  # Tool endpoints\n│   │       ├── get-blockchains/\n│   │       ├── create-near-transaction/\n│   │       ├── create-evm-transaction/\n│   │       ├── eth-sign-request/\n│   │       ├── get-user/\n│   │       ├── twitter/\n│   │       └── coinflip/\n│   ├── config.ts                   # Environment configuration\n│   ├── layout.tsx                  # Root layout\n│   └── page.tsx                    # Home page\n├── public/                         # Static assets\n├── package.json                    # Dependencies and scripts\n└── README.md                       # This file\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## 📄 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n---\n\nBuilt with ❤️ using [Bitte Protocol](https://bitte.ai)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBitteProtocol%2Fagent-next-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBitteProtocol%2Fagent-next-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBitteProtocol%2Fagent-next-boilerplate/lists"}