feat: update .gitignore, auth configuration, and add GitHub API client

This commit is contained in:
2026-02-12 21:14:23 +08:00
parent d808f8b59b
commit 55414d0693
8 changed files with 40 additions and 4 deletions

18
src/github/get.ts Normal file
View File

@@ -0,0 +1,18 @@
import { api } from '@/convex/_generated/api.js';
import { ConvexClient, AuthTokenFetcher } from "convex/browser";
const url = process.env["CONVEX_URL"]
const client = new ConvexClient(url!);
const token = process.env["KEVISUAL_CONVEX_TOKEN"]
const authTokenFetcher: AuthTokenFetcher = async ({ forceRefreshToken }: { forceRefreshToken: boolean }) => {
console.log("AuthTokenFetcher called, forceRefreshToken:", forceRefreshToken);
return token;
}
client.setAuth(authTokenFetcher, (isAuthenticated) => {
console.log("Auth isAuthenticated:", isAuthenticated);
});
await Bun.sleep(1000);
const list = await client.query(api.github.starrred.get, {})
console.log('list', list)