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. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. O’Reilly Online Learning
    4. How to Contact Us
    5. Acknowledgments
  2. 1. Welcome to the Fediverse
    1. What social networks do
    2. What social networks don’t do
      1. Locked in to social networks
    3. From social network to social web
    4. A tour of the standards
      1. Activity Streams 2.0
      2. The ActivityPub API
      3. The ActivityPub protocol
    5. A brief history of the fediverse
    6. A tour of the fediverse today
    7. What the fediverse holds in store tomorrow
  3. 2. Activity Streams 2.0
    1. The first steps
    2. Publishers and consumers
    3. Type
    4. Identity
    5. Vocabulary
    6. Properties
    7. Activity types
    8. Actor types
    9. Object types
      1. HTML
      2. Attachments and tags
    10. Collections
    11. Addressing objects
    12. Internationalization
    13. Timestamps
    14. Type hierarchy
    15. External vocabularies
    16. Internet media type
    17. Representation granularity
      1. ID-string representation
      2. Brief representation
      3. Functional representation
      4. Link representation
      5. Full representation
    18. Names
    19. Using Activity Streams 2.0
    20. Storing AS2 documents
      1. Storing collections
    21. 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
      1. Handling errors
    6. Making things
      1. Create
      2. Update
      3. Delete
      4. Implicit create
    7. Modifying the social 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 ActivityPub 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. Filtering activities
    11. Optimizing federated servers
    12. Server checklist
    13. Conclusion
  6. 5. Extending ActivityPub
    1. Senders and receivers
      1. Receiving Extended Properties
      2. Receiving Extended Types
      3. Sending Extended Properties
      4. Sending Extended Types
    2. Using the Rest of the Activity Vocabulary
      1. Polls
      2. Account portability
      3. Events
      4. Groups
      5. Geosocial
      6. Media experiences
    3. Using Other Well-Known Vocabularies
      1. Miscellany
      2. vCard
      3. Schema.org
      4. Dublin Core
    4. Creating a New Vocabulary
      1. Defining the terms
      2. Defining the context document
      3. Publishing the documentation
      4. Growing an extension
    5. Conclusion
  7. 6. Far Horizons
    1. Near horizons
    2. Objects as actors
    3. Search
    4. Artificial intelligence
    5. Content management
    6. Games
    7. Health Tracking
    8. Internet of Things
    9. Dating
    10. Enterprise software
    11. Software development
    12. Payments
    13. Marketplace
    14. Happiness
    15. Conclusion
  8. A. Activity Vocabulary Types
    1. Groups
    2. Accept
    3. Activity
    4. Add
    5. Announce
    6. Application
    7. Arrive
    8. Article
    9. Audio
    10. Block
    11. Collection
    12. CollectionPage
    13. Create
    14. Delete
    15. Dislike
    16. Document
    17. Event
    18. Flag
    19. Follow
    20. Group
    21. Ignore
    22. Image
    23. IntransitiveActivity
    24. Invite
    25. Join
    26. Leave
    27. Like
    28. Link
    29. Listen
    30. Mention
    31. Move
    32. Note
    33. Object
    34. Offer
    35. OrderedCollection
    36. OrderedCollectionPage
    37. Organization
    38. Page
    39. Person
    40. Place
    41. Profile
    42. Question
    43. Read
    44. Reject
    45. Relationship
    46. Remove
    47. Service
    48. TentativeAccept
    49. TentativeReject
    50. Tombstone
    51. Travel
    52. Undo
    53. Update
    54. Video
    55. View
  9. B. Activity Streams 2.0 properties
    1. Groups
    2. accuracy
    3. actor
    4. alsoKnownAs
    5. altitude
    6. anyOf
    7. attachment
    8. attributedTo
    9. audience
    10. bcc
    11. bto
    12. cc
    13. closed
    14. content
    15. contentMap
    16. context
    17. current
    18. deleted
    19. describes
    20. duration
    21. endpoints
    22. endTime
    23. first
    24. following
    25. followers
    26. formerType
    27. generator
    28. height
    29. href
    30. hreflang
    31. icon
    32. id
    33. image
    34. inbox
    35. inReplyTo
    36. instrument
    37. items
    38. last
    39. latitude
    40. liked
    41. likes
    42. location
    43. longitude
    44. mediaType
    45. name
    46. nameMap
    47. next
    48. object
    49. oneOf
    50. origin
    51. outbox
    52. partOf
    53. preferredUsername
    54. prev
    55. preview
    56. published
    57. radius
    58. rel
    59. relationship
    60. replies
    61. result
    62. shares
    63. source
    64. startIndex
    65. startTime
    66. streams
    67. subject
    68. summary
    69. summaryMap
    70. tag
    71. target
    72. to
    73. totalItems
    74. type
    75. units
    76. updated
    77. url
    78. width
  10. About the Author

Product information

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