PHPackages                             pterotype/activitypub-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pterotype/activitypub-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pterotype/activitypub-php
=========================

An ActivityPub library

84169[3 issues](https://github.com/pterotype-project/activitypub-php/issues)[1 PRs](https://github.com/pterotype-project/activitypub-php/pulls)PHP

Since May 26Pushed 6y ago12 watchersCompare

[ Source](https://github.com/pterotype-project/activitypub-php)[ Packagist](https://packagist.org/packages/pterotype/activitypub-php)[ RSS](/packages/pterotype-activitypub-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

ActivityPub-PHP
===============

[](#activitypub-php)

> A library to turn any PHP project into a full [ActivityPub](https://activitypub.rocks) implementation

**This library is a work-in-progress. The documentation below reflects what the API will look like once it's done.**

ActivityPub-PHP is a library that embeds a full ActivityPub server into any PHP project. It works with any SQL database and any web framework. At a high level, it provides a request handler that you can route ActivityPub requests to which will take care of persisting the received activity, performing any necessary side effects, and delivering the activity to other federated servers. It also provides a PHP API to create and manage actors and activities.

What it does
------------

[](#what-it-does)

- stores incoming activities to your project's existing SQL database in a configurable fashion
- implement both the client-to-server and the server-to-server parts of the ActivityPub protocol
- verify HTTP signatures on incoming ActivityPub requests and sign outgoing ActivityPub requests
- provide a PHP API so you can create and manage actors and send activities directly from code
- hook into your application's user authentication logic to provide ways to associate your users with ActivityPub actors
- manage the JSON-LD context for you, with hooks if you need to add custom fields
- support PHP &gt; 5.\*

What it doesn't do
------------------

[](#what-it-doesnt-do)

- handle standalone user authentication - this is up to your particular application
- support non-SQL databases
- provide a UI

Installation
------------

[](#installation)

ActivityPub-PHP is available via Composer:

```
$ composer require pterotype/activitypub-php

```

Usage
-----

[](#usage)

Basic usage example:

```
