TypeScript APIs for various Versia services.
Find a file
2024-11-28 11:14:26 +01:00
.github/workflows ci: 👷 Add Codeberg mirror CI workflow 2024-11-04 11:42:07 +01:00
.vscode feat(client): Add client package 2024-06-06 15:51:33 -10:00
client feat(client): Add full 0.8 Role API 2024-11-28 11:14:26 +01:00
federation chore(federation): 🔖 [publish] Release 0.1.4 2024-11-23 14:20:50 +01:00
.gitignore feat(build): 👷 Add automatic CI build and deploy to NPM 2024-05-13 21:35:05 -10:00
.npmignore fix: 💚 Fix NPM not finding built JS 2024-07-22 23:20:51 +02:00
biome.json chore: ⬆️ Upgrade dependencies 2024-10-14 18:03:21 +02:00
build.ts refactor(federation): 🚚 Rename validators back to schemas, fix barrel file 2024-09-23 09:44:20 +02:00
bun.lockb chore: ⬆️ Upgrade dependencies 2024-10-24 17:28:27 +02:00
LICENSE refactor: 🚚 Rename Lysand to Versia 2024-08-24 14:58:50 +02:00
package.json chore: ⬆️ Upgrade dependencies 2024-10-24 17:28:27 +02:00
README.md refactor: ♻️ Use new Versia assets 2024-08-28 00:24:28 +02:00
tsconfig.json refactor(federation): 🚚 Remove custom path alias 2024-07-23 00:11:05 +02:00

Versia Logo

Versia API

Set of NPM packages written in TypeScript to interact with Versia-compatible services.

Packages

  • @versia/federation: Federation types, validators and cryptography for Versia server implementations.
  • @versia/client: Client for the reference Versia Server implementation.

Efficiency

The built output of each package is not even 200 KB in size, making it a lightweight and efficient solution for your Versia needs. Installing the package adds around 5 MB to your node_modules folder, but this does not affect the final bundle size.

Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second.

Usage

Federation

Please see the @versia/federation README for more information.

Client

Please see the @versia/client README for more information.

Getting Started

Prerequisites

For Usage

See the Compatibility section for the supported environments. Any package manager can be used to install the packages.

For Development

  • Bun version 1.1.8 or higher.
  • Either the Linux or macOS operating systems. (Windows will work, but is not officially supported.)

Compatibility

This library is built for JavaScript runtimes with the support for:

Runtimes

  • Node.js: 14.0+ is the minimum, but only Node.js 20.0+ (LTS) is officially supported.
  • Deno: Support is unknown. 1.0+ is expected to work.
  • Bun: Bun 1.1.8 is the minimum-supported version. As Bun is rapidly evolving, this may change. Previous versions may also work.

Browsers

Consequently, this library is compatible without any bundling in the following browser versions:

  • Chrome: 80+
  • Edge: 80+
  • Firefox: 74+
  • Safari: 13.1+
  • Opera: 67+
  • Internet Explorer: None

If you are targeting older browsers, please don't, you are doing yourself a disservice.

Transpilation to non-ES Module environments is not officially supported, but should be simple with the use of a bundler like Parcel or Rollup.

Installation

Both packages are distributed as a scoped package on the NPM registry or JSR.

We strongly recommend using JSR over NPM for all your packages that are available on it.

# NPM version
deno add npm:@versia/federation npm:@versia/client # For Deno
npm install @versia/federation @versia/client # For NPM
yarn add @versia/federation @versia/client # For Yarn
pnpm add @versia/federation @versia/client # For PNPM
bun add @versia/federation @versia/client # For Bun

# JSR version
deno add @versia/federation @versia/client # For Deno
npx jsr add @versia/federation @versia/client # For JSR
yarn dlx jsr add @versia/federation @versia/client # For Yarn
pnpm dlx jsr add @versia/federation @versia/client # For PNPM
bunx jsr add @versia/federation @versia/client # For Bun

From Source

If you want to install from source, you can clone this repository and run the following commands:

bun install # Install dependencies

bun run build # Build the packages

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Projects

  • Bun: Thanks to the Bun team for creating an amazing JavaScript runtime.
  • TypeScript: TypeScript is the backbone of this project.
  • Node.js: Node.js created the idea of JavaScript on the server.

People

  • April John: Creator and maintainer of the Versia Server ActivityPub bridge.