Files
twenty/packages/twenty-website-new/src/lib/community/fetch-github-star-count.ts
T
Abdullah. 3a1e112b86 Fixes and updates to the website. (#19350)
This PR implements a whole lot of fixes and updates to the website. It
adds a release-notes page, terms and conditions page, privacy policy
page, while fixing HomeStepper, ProductStepper, and WhyTwentyStepper. 3D
models still need to be styled and their sizes need to be fixed.
2026-04-06 09:42:30 +02:00

24 lines
558 B
TypeScript

import axios from 'axios';
export async function fetchGithubStarCount(): Promise<number | null> {
try {
const headers: Record<string, string> = {
Accept: 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28',
};
if (process.env.GITHUB_TOKEN) {
headers.Authorization = `Bearer ${process.env.GITHUB_TOKEN}`;
}
const response = await axios.get(
'https://api.github.com/repos/twentyhq/twenty',
{ headers },
);
return response.data.stargazers_count;
} catch {
return null;
}
}