A Typescript library to access Forgejo via its api
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maxim Slipenko f3d805c07b
All checks were successful
Test / test (push) Successful in 26s
chore: update README.md
2026-07-21 18:16:10 +03:00
.forgejo/workflows ci: correct runs-on for release workflow 2026-07-21 18:12:47 +03:00
contrib feat: support forgejo 11 (#2) 2025-05-13 09:11:13 +00:00
src feat: support forgejo 16 2026-07-21 18:06:46 +03:00
.env.example 🎉 init 2024-12-09 20:03:43 +01:00
.gitignore 🎉 init 2024-12-09 20:03:43 +01:00
.prettierignore 💄 fix format check 2024-12-09 20:55:27 +01:00
.prettierrc.js 🎉 init 2024-12-09 20:03:43 +01:00
.releaserc.json 🎉 init 2024-12-09 20:03:43 +01:00
LICENSE 🎉 init 2024-12-09 20:03:43 +01:00
package.json feat: support forgejo 16 2026-07-21 18:06:46 +03:00
pnpm-lock.yaml feat: support forgejo 11 (#2) 2025-05-13 09:11:13 +00:00
pnpm-workspace.yaml chore: correct formatting 2026-07-21 16:44:27 +03:00
README.md chore: update README.md 2026-07-21 18:16:10 +03:00
tsconfig.json 🎉 init 2024-12-09 20:03:43 +01:00
vite.config.ts 🎉 init 2024-12-09 20:03:43 +01:00

Forgejo-js api client with Typescript support

NPM Version NPM Types NPM license

Forgejo-js is an api client automatically created from the official OpenAPI definition of Forgejo. The client uses the Fetch Api (native browser support) to make requests. For node you can use cross-fetch to polyfill the Fetch Api.

For Gitea you can use gitea-js.

Version mapping

The major and minor version of this library is mapped to the version of the Forgejo api. The patch version of this library is incremented for every release and uses the latest patch version of Forgejo.

Forgejo-js Forgejo
16.0.x 16.0
15.0.x 15.0
11.0.x 11.0

Examples

Browser

import { forgejoApi } from 'forgejo-js';

const api = forgejoApi('https://codeberg.org/', {
  token: 'access-token', // generate one at https://forgejo.example.com/user/settings/applications
});

const repo = api.repos.repoGet('anbraten', 'forgejo-js');
console.log(repo);

Node.js

const { forgejoApi } = require('forgejo-js');
const fetch = require('cross-fetch'); // You have to use a fetch compatible polyfill like cross-fetch for older Node.JS versions

const api = forgejoApi('https://codeberg.org/', {
  token: 'access-token', // generate one at https://forgejo.example.com/user/settings/applications
  customFetch: fetch,
});

const repo = api.repos.repoGet('anbraten', 'forgejo-js');
console.log(repo);