{"id":20974217,"url":"https://github.com/thirdweb-example/community-rewards","last_synced_at":"2025-05-14T12:31:12.653Z","repository":{"id":107807782,"uuid":"495201877","full_name":"thirdweb-example/community-rewards","owner":"thirdweb-example","description":"Reward your community using NFTs and thirdweb's signature based minting.","archived":false,"fork":false,"pushed_at":"2024-04-12T00:33:24.000Z","size":209,"stargazers_count":25,"open_issues_count":0,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-12T07:13:07.854Z","etag":null,"topics":["nft-collection","signature-based-minting"],"latest_commit_sha":null,"homepage":"https://community-rewards.thirdweb-example.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thirdweb-example.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-05-22T23:33:24.000Z","updated_at":"2023-09-13T02:20:56.000Z","dependencies_parsed_at":"2024-04-18T20:33:35.476Z","dependency_job_id":null,"html_url":"https://github.com/thirdweb-example/community-rewards","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"thirdweb-example/next-javascript-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fcommunity-rewards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fcommunity-rewards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fcommunity-rewards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fcommunity-rewards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thirdweb-example","download_url":"https://codeload.github.com/thirdweb-example/community-rewards/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225294242,"owners_count":17451498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["nft-collection","signature-based-minting"],"created_at":"2024-11-19T04:27:15.174Z","updated_at":"2024-11-19T04:27:17.311Z","avatar_url":"https://github.com/thirdweb-example.png","language":"TypeScript","readme":"\u003e [!Important]  \n\u003e This repository is referencing the `mumbai` chain.\n\u003e \n\u003e `Mumbai` [is deprecated since 08/04/2024](https://blog.thirdweb.com/deprecation-of-mumbai-testnet/), meaning the code in this repository will no longer work out of the box.\n\u003e\n\u003e You can still use this repository, however you will have to switch any references to `mumbai` to another chain.\n\n# Community Rewards\n\n## Introduction\n\nThis example utilizes [signature-based minting](https://portal.thirdweb.com/advanced-features/on-demand-minting) of NFTs as a mechanism to reward users of a specific community. We connect user's with their Discord account, and generate signatures for an NFT if the user is a **member** of the Discord server.\n\n## Using This Template\n\nCreate a project using this example:\n\n```bash\nnpx thirdweb create --template\ncommunity-rewards\n```\n\n- Create an [NFT Collection](https://thirdweb.com/thirdweb.eth/TokenERC721) contract using the dashboard.\n- Update the contract address and discord server id in the [consts](./consts.ts) file.\n\n### Setting up Discord OAuth\n\nHead to the [Discord Developer portal](https://discord.com/developers/applications) and create a new application.\n\nUnder the `Oauth2` tab, copy your client ID and client secret. We need to store these as environment variables in our project so that we can use them on the API routes in our application.\n\nCreate a file at the root of your project called `.env.local` and add the following lines:\n\n```bash\nCLIENT_ID=\u003cyour-discord-client-id-here\u003e\nCLIENT_SECRET=\u003cyour-discord-client-secret-here\u003e\n```\n\nBack in the Discord portal, under the `Redirects` section, you need to add the following value as a redirect URI:\n\n```\nhttp://localhost:3000/api/auth/callback/discord\n```\n\nYou need to have an environment variable called `NEXTAUTH_SECRET` for the Discord Oauth to work.\n\nYou can learn more about it here:\nhttps://next-auth.js.org/configuration/options\n\nYou can quickly create a good value on the command line via this openssl command.\n\n```bash\nopenssl rand -base64 32\n```\n\nAnd add it as an environment variable in your `.env.local` file:\n\n```\nNEXTAUTH_SECRET=\u003cyour-value-here\u003e\n```\n\n### Other Environment Variables\n\nTo run this project, you will need to add the following environment variables to your `.env.local` file:\n\nWALLET_PRIVATE_KEY=\nNEXT_PUBLIC_TEMPLATE_CLIENT_ID=\nTW_SECRET_KEY=\n\n- Generate your `TW_SECRET_KEY` and `NEXT_PUBLIC_TEMPLATE_CLIENT_ID` via thirdweb's dashboard.\n- For `WALLET_PRIVATE_KEY` export your wallet private key from your wallet.\n\n## Run Locally\n\nInstall dependencies\n\n```bash\n  # npm\n  npm install\n\n  # yarn\n  yarn install\n```\n\nStart the server\n\n```bash\n  # npm\n  npm run start\n\n  # yarn\n  yarn start\n```\n\n## Additional Resources\n\n- [Documentation](https://portal.thirdweb.com)\n- [Templates](https://thirdweb.com/templates)\n- [Video Tutorials](https://youtube.com/thirdweb_)\n- [Blog](https://blog.thirdweb.com)\n\n## Contributing\n\nContributions and [feedback](https://feedback.thirdweb.com) are always welcome! Please check our [open source page](https://thirdweb.com/open-source) for more information.\n\n## Need help?\n\nFor help, join the [discord](https://discord.gg/thirdweb) or visit our [support page](https://support.thirdweb.com).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fcommunity-rewards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthirdweb-example%2Fcommunity-rewards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fcommunity-rewards/lists"}