Follow Reviews on the Fediverse

Every reviewer and every subject in the Mangrove dataset has an ActivityPub account on social.mangrove.reviews. A person who follows one from Mastodon, or any other Fediverse client, sees each new review as a post in their own timeline. Every subject and reviewer page on mangrove.reviews has a Follow button for this. To offer it in your website or app you need two things: the account handle, and a way to open the follow dialog.

Get the handle

Ask the bridge for it with the mangrove-reviews package. The account is created on the first request.

import { getFediverseHandle } from 'mangrove-reviews'

const place = await getFediverseHandle({ sub: 'geo:52.2413461,21.0232545?q=SAM&u=10' })
const reviewer = await getFediverseHandle({ kid: publicKeyPem })

The sub is a subject identifier under the Mangrove Review Standard, the same value you use when reading or writing reviews. A subject needs no reviews yet, so a user can follow a place before its first review. A reviewer’s key must have at least one review in the dataset. Apps in other languages call the two endpoints in the bridge’s OpenAPI document.

Both calls return the same JSON:

{
  "handle": "s-53903f06473e9d0a",
  "acct": "@s-53903f06473e9d0a@social.mangrove.reviews",
  "actor": "https://social.mangrove.reviews/actors/s-53903f06473e9d0a",
  "name": "SAM"
}

Show the handle

Display acct next to the place or the reviewer, with a copy button. A user pastes it into the search box of their Fediverse client and follows from there.

Open the follow dialog directly

Mastodon servers accept a remote-interaction link. Ask the user once for the server their account is on, remember it, and open the link the library builds:

import { followUrl } from 'mangrove-reviews'

window.open(followUrl('mastodon.social', place.actor))

The user lands on their own server’s follow page for the account. This is what the Follow button on mangrove.reviews does, and the widget shows the account with a copy button under every subject.

What followers receive

A post with the stars, the subject’s name linked to its page, the opinion, any images, and a link to the full review. A subject account boosts the reviewer’s post to its own followers. Each post carries the signed review under a mangrove:jwt property, so a server that understands Mangrove can verify it.

The bridge is part of the Mangrove repository, under the Apache License 2.0. Its endpoints are in its OpenAPI document.