Build cross-platform Mastodon and Fediverse integrations with TootSDK, a Swift library.
masto.js
Build JavaScript integrations with the Mastodon API using masto.js, a universal client library.

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
- 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
- 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
- Website
- github.com/neet/masto.js
- Category
- Social & Communities › Fediverse
- 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.
Go projects can interact with the Mastodon API using go-mastodon, a client library for the programming language.
The Mastodon API is accessible from a terminal through madonctl, a Go command-line client.
Elk Native is a native version of Elk, described as a Mastodon web client.
Use Megalodon, a Fediverse API client library for Node.js and browser environments.
FediverseRedirect deep-links Mastodon and Lemmy addresses into Android apps, including browsers and mobile clients.
Popular in Fediverse
Well-known listings from the same topic.
masto.js FAQ
Which runtimes does masto.js support?
What dependencies are required for the quick start?
How do you authenticate with masto.js?
Tell us and an editor will check it.
Claim the listing and suggest updates yourself. An editor checks every claim first.












