Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

update guides to use GH OAuth instead

Steven Tey0c91098457d6
diff --git a/apps/docs/local-development.mdx b/apps/docs/local-development.mdx
index 10a94e369b..c826d60b4c 100644
--- a/apps/docs/local-development.mdx
+++ b/apps/docs/local-development.mdx
@@ -178,7 +178,20 @@ Then, create the database tables with the following command:
npx prisma db push
```
-### Step 5: Start the development server
+## Step 5: Set up GitHub OAuth
+
+Next, follow [these steps](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps) to create a GitHub App. This will let you sign in to Dub with your GitHub account.
+
+Don't forget to set this Callback URLs `http://localhost:8888/api/auth/callback/github` for local development.
+
+<Info>
+ Optional: Set the "Email addresses" account permission to **read-only** in
+ order to access private email addresses on GitHub.
+</Info>
+
+Once your GitHub App is created, copy the `Client ID` and `Client Secret` into your `.env` file as the `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` environment variables.
+
+### Step 6: Start the development server
Finally, you can start the development server. This will build the packages + start the app servers.
diff --git a/apps/docs/self-hosting/guide.mdx b/apps/docs/self-hosting/guide.mdx
index 7d17586f4a..9bdaf05089 100644
--- a/apps/docs/self-hosting/guide.mdx
+++ b/apps/docs/self-hosting/guide.mdx
@@ -19,7 +19,6 @@ Before you begin, make sure you have the following:
- A [Tinybird](https://www.tinybird.co/) account
- An [Upstash](https://upstash.com/) account
- A [Planetscale](https://planetscale.com/) account
-- A [Resend](https://resend.com/) account
- A [Vercel](https://vercel.com/) account
## Step 1: Local setup
@@ -133,18 +132,31 @@ Then, create the database tables with the following command:
npx prisma db push
```
-## Step 5: Set up Resend
+## Step 5: Set up GitHub OAuth
-Next, you'll need to set up Resend for transactional emails (e.g. magic link emails):
+Next, follow [these steps](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps) to create a GitHub App. This will allow users to sign in with their GitHub accounts.
-1. In your [Resend account](https://resend.com/overview), create a new API key.
+Don't forget to set the following Callback URLs:
+
+- `https://app.yourdomain.com/api/auth/callback/github`
+- `http://localhost:8888/api/auth/callback/github` for local development.
+
+<Info>
+ Optional: Set the "Email addresses" account permission to **read-only** in
+ order to access private email addresses on GitHub.
+</Info>
-![Resend API key](/images/resend-api-key.png)
+Once your GitHub App is created, copy the `Client ID` and `Client Secret` into your `.env` file as the `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` environment variables.
+## Step 6: Set up Resend (optional)
+
+Next, you'll need to set up Resend for transactional emails (e.g. magic link emails):
+
+1. In your [Resend account](https://resend.com/overview), create a new API key.
2. Copy the API key into your `.env` file as the `RESEND_API_KEY` environment variable.
3. You'll then need to set up MX records for your domain to start working. You can follow this guide to learn [how to set up MX records with Resend](https://resend.com/docs/dashboard/domains/introduction).
-## Step 6: Set up Cloudinary & Unsplash (optional)
+## Step 7: Set up Cloudinary & Unsplash (optional)
If you want to enable the [Custom Social Media Cards](https://dub.co/help/article/how-to-create-link#custom-social-media-cards) feature, you'll need to set up Cloudinary and Unsplash: