mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-19 06:14:16 -05:00
15 lines
344 B
TypeScript
15 lines
344 B
TypeScript
import { Octokit } from 'octokit';
|
|
import type { H3Event } from 'h3';
|
|
|
|
let octokit: Octokit | null = null;
|
|
|
|
export function useOctokit(event: H3Event): Octokit | null {
|
|
if (!octokit) {
|
|
const config = useRuntimeConfig(event);
|
|
if (config.githubApiToken) {
|
|
octokit = new Octokit({ auth: config.githubApiToken });
|
|
}
|
|
}
|
|
return octokit;
|
|
}
|