feat: wire DOCUSAURUS_GIT_TOKEN to GitHub service for live discussions#1332
Merged
feat: wire DOCUSAURUS_GIT_TOKEN to GitHub service for live discussions#1332
Conversation
4 tasks
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…m Docusaurus config - Add setToken() method to GitHubService and update getHeaders() to use the stored token - Dashboard now reads gitToken from customFields (DOCUSAURUS_GIT_TOKEN env var) and initializes the service before fetching discussions - Add Refresh button with spinning animation to allow manual re-fetching - Improve error message to include a direct link to GitHub Discussions - Update discussions.css with refresh button styles and spin animation - Update .env.example to document DOCUSAURUS_GIT_TOKEN Agent-Logs-Url: https://github.com/recodehive/recode-website/sessions/7b2120a4-0104-4379-aa97-06aed89d4a29
Copilot
AI
changed the title
[WIP] Implement dynamic mapping for discussions section
feat: wire DOCUSAURUS_GIT_TOKEN to GitHub service for live discussions
Apr 22, 2026
Member
|
so this will require updating the env with GIT_TOKEN along with the docusaurus one |
Member
|
Hi @sanjay-kv could you look into the vercel deployment and let me know if things are working fine ? |
|
🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. I would be grateful if you can nominate for keeping this opensource project live and running Link to Nominate. Please do star the repo and Keep up the fantastic work! 🚀 |
Member
|
@Adez017 it looks good in the preview. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Discussions tab always rendered hardcoded mock data because
githubService.getHeaders()checkedwindow.GITHUB_TOKEN(never set at runtime), while the actual token was already available incustomFields.gitToken(fromDOCUSAURUS_GIT_TOKENenv var) — the same patternstatsProvider.tsxuses correctly for leaderboard data.Changes Made
githubService.ts— Addedprivate tokenfield +setToken(token: string)method; updatedgetHeaders()to prefer stored token, fall back towindow.GITHUB_TOKENdashboard/index.tsx— AddeduseDocusaurusContextto readcustomFields.gitToken; callsgithubService.setToken()on mount; added a Refresh button (with spin animation) for manual re-fetch; error state now surfaces a direct link to GitHub Discussions when the API call failsdiscussions.css— Styles for.refresh-discussions-btn,@keyframes spin, and.spinning.env.example— DocumentedDOCUSAURUS_GIT_TOKENwith required scope (read:discussion)When
DOCUSAURUS_GIT_TOKENis set in the deployment environment, the section fetches live discussions via GitHub GraphQL. Without a token, an error with a fallback link to the GitHub Discussions page is shown instead of silent mock data.Dependencies
No new dependencies.
Checklist
npm run buildand attached screenshot(s) in this PR.