ActivityPub

Book description

ActivityPub is the new standard for connecting social networks together on the social web. This open, decentralized social networking protocol defines an API for sharing activities to a social network and a procedure that servers use to distribute those activities to a subscriber's feed. With this book, you'll learn how to assemble ActivityPub-enabled clients for making new kinds of social apps on top of existing networks and build ActivityPub servers that create new human or automated accounts on the social web.

With those skills under your belt, you can explore other applications of this publish-subscribe technology: content management systems, internet of things, and enterprise automation. With hands-on examples and in-depth knowledge from Evan Prodromou, one of the authors of the protocol, this is the ActivityPub handbook that every social software hacker needs.

  • Learn what the social web is and what ActivityPub does
  • Represent social network data in the Activity Streams 2.0 format
  • Write a simple ActivityPub client and server
  • Extend ActivityPub's functionality with new types
  • Find in-depth details about the more obscure ActivityPub data structures

Evan Prodromou is a coauthor of the ActivityPub protocol and the Activity Streams 2.0 data format.

Publisher resources

View/Submit Errata

Table of contents

  1. Brief Table of Contents (Not Yet Final)
  2. 1. Welcome to the Fediverse
    1. 1.1 What social networks do
    2. 1.2 What social networks don’t do
    3. 1.3 From social network to social web
    4. 1.4 Activity Streams 2.0
    5. 1.5 The ActivityPub protocol
    6. 1.6 The ActivityPub API
    7. 1.7 A brief history of the fediverse
    8. 1.8 A tour of the fediverse today
    9. 1.9 What the fediverse holds in store tomorrow
  3. 2. Activity Streams 2.0
    1. The first steps
    2. Type, identity, and schema
    3. Properties
    4. Activity types
    5. Actor types
    6. Object types
    7. Collections
    8. Addressing objects
    9. Internationalization
    10. Type hierarchy
    11. External vocabularies
    12. Internet media type
    13. Representation granularity
      1. ID-string representation
      2. Brief representation
      3. Functional representation
      4. Full representation
    14. Names
    15. Using Activity Streams 2.0
    16. Is it JSON or is it Linked Data?
  4. 3. The ActivityPub API
    1. A standard API
      1. The world of API Clients
      2. An extended example
      3. A follow-your-nose API
    2. Rules for ActivityPub data
    3. Reading data : The actor
      1. WebFinger for discovery
      2. OAuth 2.0 for access control
    4. Reading data
      1. The inbox and outbox
      2. The social graph
      3. Reading remote data: The proxyUrl endpoint
    5. Writing data: Activities as commands
    6. Making things
      1. Create
      2. Update
      3. Delete
      4. Implicit create
    7. Modifying the graph
      1. Follow
      2. Accept and Reject
      3. Undo
    8. Managing collections
      1. Add
      2. Remove
      3. Update
      4. Delete
    9. Reacting
      1. Like
      2. Announce
      3. inReplyTo
    10. User safety
      1. Block
      2. Flag
    11. Uploading files
    12. Authorization model
    13. Optimizing the ActivityPub API
      1. Use an HTTP cache
      2. Use data you already have
      3. Use low-resolution representations while you request higher-resolution ones in the background
      4. Reuse the output of posted activities
      5. Use GZIP compression
      6. Use “keep-alive” connections
    14. What’s Missing ?
    15. Conclusion
  5. 4. The Activity Pub Protocol
    1. An extended example
    2. The shape of federated social networking
    3. An API becomes a protocol
    4. HTTP Signatures
      1. Server-to-server authentication
      2. The Signature header
      3. Representing public keys
      4. The server actor
      5. Making requests
      6. Validating a signature
    5. WebFinger
    6. Getting objects
      1. Fetching local objects
    7. Delivering activities
      1. Shared Inbox
      2. Delivery queues
      3. Retries
      4. Delivery failure
    8. Receiving Activities
      1. Caching remote data
    9. Activity side effects
      1. Create
      2. Update
      3. Delete
      4. Add
      5. Remove
      6. Follow
      7. Accept
      8. Reject
      9. Like
      10. Announce
      11. Block
      12. Flag
      13. Undo
    10. Optimizing federated servers
    11. Conclusion
  6. 5. Extending ActivityPub
    1. Handling Extended Properties
    2. Handling Extended Types
    3. Using Extended Properties
    4. Using Extended Types
    5. Using the Rest of the Activity Vocabulary
      1. Polls
      2. Account portability
      3. Events
      4. Groups
      5. Geosocial
      6. Media experiences
    6. Using Other Well-Known Vocabularies
      1. vCard
      2. Schema.org
    7. Creating a New Vocabulary
      1. Defining the terms
      2. Defining the context document
      3. Publishing the documentation
    8. Conclusion
  7. About the Author

Product information

  • Title: ActivityPub
  • Author(s): Evan Prodromou
  • Release date: September 2024
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098169466