masto.js

github.com/neet/masto.js Fediverse Open-source projectOpen source

Build JavaScript integrations with the Mastodon API using masto.js, a universal client library.

github.com/neet/masto.js
masto.js homepage screenshot

About masto.js

masto.js is an open-source JavaScript client library for the Mastodon API, published as the npm package masto. It provides a REST API client configured with an instance URL and an access token, and the same code works in Node.js, browsers and Deno. It is written in TypeScript and ships type definitions.

Typical use is building Mastodon bots, integrations or web clients; the repository's quick-start example creates a client and publishes a status. The documented setup requires Node.js 22.x or later and npm 9.x or later, with TypeScript 5.0.0 or later as an optional peer dependency. Authentication uses a personal access token generated from an application in your own Mastodon instance settings, and requests go to the instance URL you configure; the project advises storing that token securely.

Key features

  • Works in Node.js, browsers and Deno
  • Written in TypeScript with type definitions included
  • Around 6 kB minified and gzipped
  • Tested with full coverage against a real Mastodon server
  • REST API client built from an instance URL and access token
  • Migration guides for upgrading across major versions
Best for: JavaScript and TypeScript developers building bots, tools or clients that interact with the Mastodon API.
Good for
  • Open source and distributed under the MIT license
  • Same client code targets Node.js, browsers and Deno
  • Maintained by its author since 2018 and used by clients such as Elk and Phanpy
Watch out for
  • Requires Node.js 22.x or later and npm 9.x or later for the documented setup
  • Needs a personal access token created from an application in your Mastodon instance settings

masto.js at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

masto.js alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

go-mastodon

github.com/mattn/go-mastodon

Go projects can interact with the Mastodon API using go-mastodon, a client library for the programming language.

Open source
24 alternatives

Popular in Fediverse

Well-known listings from the same topic.

All 113

masto.js FAQ

Which runtimes does masto.js support?
It is described as universal and works in Node.js, browsers and Deno.
What dependencies are required for the quick start?
Node.js 22.x or later and npm 9.x or later; TypeScript 5.0.0 or later is an optional peer dependency. Other package managers such as yarn or pnpm can be used to install it.
How do you authenticate with masto.js?
Create an application in your Mastodon instance's settings under Development to obtain a personal access token, choose scopes such as read and write for most functionality, then pass the instance URL and token when creating the client.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing