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.

Send Ahrefs API key as Bearer auth

Kiran Kb2939c8b3504
diff --git a/apps/web/.env.example b/apps/web/.env.example
index fe76db1ae1..e948de773b 100644
--- a/apps/web/.env.example
+++ b/apps/web/.env.example
@@ -157,6 +157,7 @@ TWITTER_CLIENT_SECRET=
TIKTOK_CLIENT_ID=
TIKTOK_CLIENT_SECRET=
YOUTUBE_API_KEY=
+AHREFS_API_KEY=
# Scrape Creators
SCRAPECREATORS_API_KEY=
diff --git a/apps/web/lib/ahrefs/client.ts b/apps/web/lib/ahrefs/client.ts
index fdfda5db12..fdec52a7b9 100644
--- a/apps/web/lib/ahrefs/client.ts
+++ b/apps/web/lib/ahrefs/client.ts
@@ -1,3 +1,4 @@
+import { assertEnv } from "@/lib/assert-env";
import { HttpBaseClient } from "@/lib/http/base-client";
import {
getDomainRatingInputSchema,
@@ -13,7 +14,9 @@ class AhrefsClient extends HttpBaseClient {
}
protected buildAuthHeaders() {
- return {};
+ return {
+ Authorization: `Bearer ${assertEnv("AHREFS_API_KEY")}`,
+ };
}
// GET /v3/public/domain-rating-free