Skip to content

Full Toolkit for Next-Level Domain Analysis

Fix app crashing if GITHUB_TOKEN env is not provided ✅

Felix Wotschofsky48dfa2793b67
diff --git a/lib/github.ts b/lib/github.ts
index ca9eff5..9a736e3 100644
--- a/lib/github.ts
+++ b/lib/github.ts
@@ -22,6 +22,11 @@ type SponsorsQueryResponse = {
};
export const getGitHubSponsors = async (username: string) => {
+ if (!env.GITHUB_TOKEN) {
+ console.warn('GITHUB_TOKEN not set; skipping GitHub sponsors');
+ return [];
+ }
+
const response = await fetch('https://api.github.com/graphql', {
method: 'POST',
headers: {