Skip to content

Commit c5d537f

Browse files
committed
fix(landing): gh stars fetch with token
1 parent c38203b commit c5d537f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sim/app/(landing)/components/github-stars.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ import { Star } from 'lucide-react'
22
import { GithubIcon } from '@/components/icons'
33

44
async function getGitHubStars() {
5+
const token = process.env.GITHUB_TOKEN
6+
57
const response = await fetch('https://api.github.com/repos/simstudioai/sim', {
68
headers: {
79
Accept: 'application/vnd.github+json',
810
'X-GitHub-Api-Version': '2022-11-28',
11+
...(token ? { Authorization: `Bearer ${token}` } : {}),
912
},
1013
next: { revalidate: 3600 }, // Revalidate every hour
1114
})
1215

1316
if (!response.ok) {
14-
// Return 0 stars if API fails, we don't want to break the UI
15-
return 0
17+
// Return current stars if API fails, we don't want to break the UI
18+
return 65
1619
}
1720

1821
const data = await response.json()

0 commit comments

Comments
 (0)