To setup the GitHub integration, you will need to setup a GitHub App for authentication. You'll need to reference the GitHub App's secret within your implementation, so you'll need a backend function. Vercel & Netlify make it really easy to to do with with their API functions.
There's a guide here showing how to set up GitHub on a NextJS site (and eventually hosting on Vercel): https://tina.io/guides/nextjs/github/initial-setup/