{"id":20974282,"url":"https://github.com/thirdweb-example/github-contributor-nft-rewards","last_synced_at":"2025-05-14T12:31:30.647Z","repository":{"id":58476554,"uuid":"530425802","full_name":"thirdweb-example/github-contributor-nft-rewards","owner":"thirdweb-example","description":"Use signature-based minting to allow users who have contributed to your github repositories to claim an NFT!","archived":false,"fork":false,"pushed_at":"2023-09-14T12:05:53.000Z","size":323,"stargazers_count":13,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-14T23:07:45.329Z","etag":null,"topics":["auth","signature-based-minting"],"latest_commit_sha":null,"homepage":"https://github-contributor-nft-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}},"created_at":"2022-08-29T23:19:26.000Z","updated_at":"2023-07-24T05:02:07.000Z","dependencies_parsed_at":"2023-02-17T16:05:29.559Z","dependency_job_id":null,"html_url":"https://github.com/thirdweb-example/github-contributor-nft-rewards","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fgithub-contributor-nft-rewards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fgithub-contributor-nft-rewards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fgithub-contributor-nft-rewards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thirdweb-example%2Fgithub-contributor-nft-rewards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thirdweb-example","download_url":"https://codeload.github.com/thirdweb-example/github-contributor-nft-rewards/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225294406,"owners_count":17451525,"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":["auth","signature-based-minting"],"created_at":"2024-11-19T04:27:42.347Z","updated_at":"2024-11-19T04:27:43.262Z","avatar_url":"https://github.com/thirdweb-example.png","language":"TypeScript","readme":"# GitHub contributors NFT rewards\n\nThis project demonstrates how you can build a full-stack web3 application that allows github contributors of certain repositories to mint an ERC 1155 NFT using signature minting.\n\n## Tools:\n\n- [React SDK](https://docs.thirdweb.com/react): To access the connected wallet, switch the user's network, and claim an NFT from our Edition Drop collection.\n- [Auth](https://portal.thirdweb.com/auth): To authenticate the user and verify them on the backend.\n\n## Using This Template\n\nCreate a project using this example:\n\n```bash\nnpx thirdweb create --template github-contributor-nft-rewards\n```\n\n- Create an edition contract on [thirdweb dashboard](https://thirdweb.com/dashboard) and lazy mint an NFT. Now, update the contract address in `pages/index.tsx` and `pages/api/claim-nft.ts` files.\n- Add your private key to the `.env.local` file.\n- Create a new OAuth app on GitHub and add the client ID and secret to the `.env.local` file.\n- Generate a new access token on Github and add it to the `.env.local` file.\n- You need the following variables in your `.env.local` file:\n\n```\nTHIRDWEB_AUTH_PRIVATE_KEY=\nGITHUB_ID=\nGITHUB_SECRET=\nGITHUB_ACCESS_TOKEN=\nNEXTAUTH_URL=\nNEXTAUTH_SECRET=\nNEXT_PUBLIC_THIRDWEB_AUTH_DOMAIN=\n```\n\n## How It Works\n\nUsing [Auth](https://portal.thirdweb.com/auth), we first authenticate the user using their web3 wallets which we later use on the backend to generate a signature. We also use next auth to authenticate users with their GitHub account, so that we can check if they have contributed to the repository.\n\nIn the api we get the thirdweb user and the next auth user. We first check if both the users are present then we validate if the user has contributed to the repository. If the user has contributed, we generate a signature using the user's private key and send it back to the frontend. The frontend then uses the signature to mint the NFT.\n\n## Join our Discord!\n\nFor any questions, suggestions, join our discord at [https://discord.gg/thirdweb](https://discord.gg/thirdweb).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fgithub-contributor-nft-rewards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthirdweb-example%2Fgithub-contributor-nft-rewards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthirdweb-example%2Fgithub-contributor-nft-rewards/lists"}