{"id":43592518,"url":"https://github.com/thenamespace/ens-subnames-rainbowkit-template","last_synced_at":"2026-04-18T07:32:51.703Z","repository":{"id":311820415,"uuid":"1045194784","full_name":"thenamespace/ens-subnames-rainbowkit-template","owner":"thenamespace","description":"Next.js starter kit for Offchain Subnames 🌈  RainbowKit using Namespace SDK.","archived":false,"fork":false,"pushed_at":"2026-01-28T12:21:10.000Z","size":849,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T17:34:11.475Z","etag":null,"topics":["ens","ethereum","nextjs","offchain-subnames","rainbowkit"],"latest_commit_sha":null,"homepage":"https://offchain-next-rainbowkit-template.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/thenamespace.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":"2025-08-26T19:45:10.000Z","updated_at":"2026-01-28T12:21:15.000Z","dependencies_parsed_at":"2025-08-27T04:14:47.371Z","dependency_job_id":"7629aa14-c6c9-4ed3-a422-57ad95c117ab","html_url":"https://github.com/thenamespace/ens-subnames-rainbowkit-template","commit_stats":null,"previous_names":["thenamespace/offchain-next-rainbowkit-template","thenamespace/ens-subnames-rainbowkit-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/thenamespace/ens-subnames-rainbowkit-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenamespace%2Fens-subnames-rainbowkit-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenamespace%2Fens-subnames-rainbowkit-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenamespace%2Fens-subnames-rainbowkit-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenamespace%2Fens-subnames-rainbowkit-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thenamespace","download_url":"https://codeload.github.com/thenamespace/ens-subnames-rainbowkit-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thenamespace%2Fens-subnames-rainbowkit-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["ens","ethereum","nextjs","offchain-subnames","rainbowkit"],"created_at":"2026-02-04T02:12:01.112Z","updated_at":"2026-04-18T07:32:51.687Z","avatar_url":"https://github.com/thenamespace.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ENS Offchain Subnames + RainbowKit Starter Kit\n\nA Next.js starter kit demonstrating the integration of [Namespace Offchain Manager SDK](https://docs.namespace.ninja/developer-guide/sdks/offchain-manager) with [RainbowKit](https://rainbowkit.com) for creating and managing Offchain ENS subnames.\n\n### Features\n\n- Rainbow Kit UI with Offchain subname creation / fetch logic.\n- You get reverse resolution for address for offchain subnames. [0x23...] -\u003e happy.offchainsub.eth\n\n**🔗 Repository:** [https://github.com/thenamespace/offchain-next-rainbowkit-template](https://github.com/thenamespace/offchain-next-rainbowkit-template)\n\n## Prerequisites\n\n- Node.js (v18 or later)\n- An ENS name (e.g., `offchainsub.eth`)\n- Namespace API key from the [Dev Portal](https://dev.namespace.ninja)\n\n## Setup\n\n### 1. Clone and Install\n\n```bash\ngit clone https://github.com/thenamespace/offchain-next-rainbowkit-template.git\ncd offchain-next-rainbowkit-template\nnpm install\n```\n\n### 2. Environment Variables\n\nCreate a `.env.local` file in the root directory:\n\n```env\n# Your ENS name (eg. offchainsub.eth)\nNEXT_PUBLIC_ENS_NAME=yourname\n\n# Your Namespace API key (keep this secret!)\nNAMESPACE_API_KEY=your_api_key_here\n```\n\n### 3. Configure Your ENS Name\n\n1. Visit the [Namespace Dev Portal](https://dev.namespace.ninja)\n2. Change the resolver for your ENS name to Namespace's resolver\n3. Generate and copy your API key\n4. Add both to your `.env.local` file\n\n### 4. Run the Development Server\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to see the application.\n\n## Features\n\nThis starter kit provides a complete implementation with:\n\n### 🔗 RainbowKit Integration\n- Custom connect button with Namespace subname support\n- Account modal with subname creation functionality\n- Automatic primary name resolution\n\n### 🏗️ Architecture\n- **Server-side Namespace client** (`/src/lib/namespace.ts`) - Uses API key securely for write operations\n- **Client-side Namespace client** (`/src/lib/namespace-client.ts`) - For read-only operations without API key exposure\n- **API route** (`/src/app/api/subname/create/route.ts`) - Server-side subname creation endpoint\n\n### 🪝 Custom Hooks\n- **`useSubnames`** - Fetch subnames for an address\n- **`useFirstSubname`** - Get the primary subname for an address  \n- **`usePreferredIdentity`** - Intelligent name resolution (subname → ENS → truncated address)\n- **`useCreateSubname`** - Create new subnames with validation\n- **`useSubnameAvailability`** - Check if a subname is available\n\n### 📡 API Endpoints\n- **`POST /api/subname/create`** - Create subnames with custom address and text records\n\n### ⚙️ Subname Configuration\n- Custom Ethereum addresses\n- Avatar/PFP support via text records\n- Display name customization\n- Metadata tracking (sender address)\n\n## Components\n\n### CustomConnectButton\nA replacement for RainbowKit's default ConnectButton that:\n- Shows subnames instead of truncated addresses\n- Displays custom avatars from subname text records\n- Provides seamless wallet connection experience\n\n### AccountModal\nA comprehensive account management interface that:\n- Shows current subname and balance\n- Allows creation of new subnames\n- Validates subname availability in real-time\n- Supports custom avatars and display names\n\n## Security \u0026 Limitations\n\n### ⚠️ Important Security Notes\n\n- **Never expose your Namespace API key to the client side**\n- API key is only used in server-side code (`/src/lib/namespace.ts` and API routes)\n- Client-side operations use the public client without API key\n\n### 📊 Rate Limits\n\n- **2,000 subnames** can be created per API key to prevent abuse\n- Need more? Contact us on [Builders Group](https://t.me/+5FAwyiKOTeswNTIy)\n\n## File Structure\n\n```\nsrc/\n├── app/\n│   ├── api/subname/create/route.ts    # Server-side subname creation\n│   ├── page.tsx                       # Main demo page\n│   └── providers.tsx                  # RainbowKit \u0026 Wagmi setup\n├── components/\n│   └── kit/\n│       ├── AccountModal.tsx           # Account management modal\n│       └── CustomConnectButton.tsx    # Custom connect button\n├── hooks/\n│   ├── use-subnames.ts               # Subname fetching hooks\n│   └── use-subname-creation.ts       # Subname creation hooks\n└── lib/\n    ├── namespace.ts                   # Server-side client (with API key)\n    └── namespace-client.ts            # Client-side client (read-only)\n```\n\n## References\n\n- **GitHub Repository**: [https://github.com/thenamespace/offchain-next-rainbowkit-template](https://github.com/thenamespace/offchain-next-rainbowkit-template)\n- **Documentation**: [https://docs.namespace.ninja/](https://docs.namespace.ninja/)\n- **SDK Reference**: [Offchain Manager SDK](https://docs.namespace.ninja/developer-guide/sdks/offchain-manager)\n- **Builders Group**: [https://t.me/+5FAwyiKOTeswNTIy](https://t.me/+5FAwyiKOTeswNTIy)\n- **RainbowKit Docs**: [https://rainbowkit.com/docs/introduction](https://rainbowkit.com/docs/introduction)\n\n## Contributing\n\nThis is a starter kit template. Feel free to customize and extend it for your specific use case. For questions or support, join our [Builders Group on Telegram](https://t.me/+5FAwyiKOTeswNTIy).\n\n## License\n\nThis project is open source and available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenamespace%2Fens-subnames-rainbowkit-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenamespace%2Fens-subnames-rainbowkit-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenamespace%2Fens-subnames-rainbowkit-template/lists"}