MCPcopy Create free account
hub / github.com/mlco2/codecarbon / createProjectToken

Function createProjectToken

webapp/src/api/projectTokens.ts:18–31  ·  view source on GitHub ↗
(
    projectId: string,
    tokenName: string,
    access?: number,
)

Source from the content-addressed store, hash-verified

16}
17
18export async function createProjectToken(
19 projectId: string,
20 tokenName: string,
21 access?: number,
22): Promise<IProjectToken> {
23 return await fetchApi(
24 `/projects/${projectId}/api-tokens`,
25 ProjectTokenSchema,
26 {
27 method: "POST",
28 body: JSON.stringify({ name: tokenName, access }),
29 },
30 );
31}
32
33export async function deleteProjectToken(
34 projectId: string,

Callers 1

handleCreateTokenFunction · 0.90

Calls 1

fetchApiFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…