CodeSight AI analyzes your GitHub repositories to find bugs, improve performance, and enforce best practices. Go from pull request to production with confidence.
1export async function getToken() {
2 const { isAuthenticated, userId } = await auth();
3 if (!isAuthenticated) {
4 throw { message: "User not found" };
5 }
6 // Get the OAuth access token for the user
7 const provider = "github";
8 const client = await clerkClient();
9 const clerkResponse = await client.users.getUserOauthAccessToken(
10 userId,
11 provider
12 );
13
14 const accessToken = clerkResponse.data[0] || "";
15 if (!accessToken) {
16 return { message: "Access token not found", status: 401 };
17 }
18 return { token: accessToken.token };
19}Go beyond linting. Get deep insights into potential bugs, performance bottlenecks, and security vulnerabilities.
Simply paste your public GitHub repository URL and start exploring. No complex setup required.
Receive clear, constructive feedback in plain English, with concrete code suggestions to improve quality.