MCPcopy
hub / github.com/gitify-app/gitify / createOctokitClient

Function createOctokitClient

src/renderer/utils/api/octokit.ts:53–69  ·  view source on GitHub ↗
(
  account: Account,
  type: APIClientType,
)

Source from the content-addressed store, hash-verified

51 * @returns A cached authenticated Octokit instance
52 */
53export async function createOctokitClient(
54 account: Account,
55 type: APIClientType,
56): Promise<OctokitClient> {
57 const cacheKey = getClientCacheKey(account, type);
58
59 // Return cached client if it exists
60 const cachedClient = octokitClientCache.get(cacheKey);
61 if (cachedClient) {
62 return cachedClient;
63 }
64
65 const client = await createOctokitClientUncached(account, type);
66 octokitClientCache.set(cacheKey, client);
67
68 return client;
69}
70
71/**
72 * Create an authenticated Octokit client instance without caching

Calls 2

getClientCacheKeyFunction · 0.85

Tested by

no test coverage detected