function receiveEvent
receiveEvent(token: string): Promise<void>

Applies the signed event token from a user's home, for POST /api/federation/events: update brings their account in step, revoke ends their sessions here. Only an instance some account here comes from, and not blocked, may send one, about one of those accounts, and at most EVENT_LIMIT's rate. The sender gives up on an event at a 4xx other than 429, and tries it again later otherwise.

Parameters

token: string

Return Type

Promise<void>

Throws

APIException

400 when it isn't an event of a known instance about one of its users; 401 when it doesn't verify; 403 when the instance is blocked; 429 when it sends too many; 502 when its keys can't be fetched.

Usage

import { receiveEvent } from "api/services/federation-service.ts";