feat: update .gitignore, auth configuration, and add GitHub API client
This commit is contained in:
18
src/github/get.ts
Normal file
18
src/github/get.ts
Normal 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)
|
||||
Reference in New Issue
Block a user