This service allows you to create an ActivityPub server with data stored in a triple store.


  • Store activities, actors and objects in the triple store
  • Handle all kind of ontologies (see additionalContext setting)
  • Allow to create actors when new WebIDs are created
  • Currently supported activities:
    • Create
    • Update
    • Delete
    • Follow



  • ActivityService
  • ActorService
  • CollectionService
  • FollowService
  • InboxService
  • ObjectService
  • OutboxService


$ npm install @semapps/activitypub --save


const { ActivityPubService } = require('@semapps/activitypub');
module.exports = {
mixins: [ActivityPubService],
settings: {
baseUri: 'http://localhost:3000/',
containers: {
activities: '/activities',
actors: '/actors',
objects: '/objects'
additionalContext: {
foaf: ''

Configure the API routes

const { ApiGatewayService } = require('moleculer-web');
module.exports = {
mixins: [ApiGatewayService],
dependencies: ['activitypub'],
async started() {
// Other routes here...
].forEach(route => this.addRoute(route));

Queue federation POSTs

If you want to make sure no data is lost when trying to POST to remote ActivityPub servers, you can set the queueServiceUrl settings.

The Bull task manager will queue the task and you will be able to retry it if it fails.

Create actors on WebID creations

This is done automatically when a webid.created event is detected.


baseUriStringrequiredBase URI of your web server
containersObjectPath of the containers for the activities, actors and objects.
additionalContextObjectThe ActivityStreams ontology is the base ontology, but you can add more contexts here if you wish.
queueServiceUrlStringRedis connection string. If set, the Bull task manager will be used to handle federation POSTs.


The following service actions are available:



Object - Routes formatted for the Moleculer ApiGateway