Saltearse al contenido
Web Monetization logo Web Monetization
GitHub

Activity Streams JSON-LD

Esta página aún no está disponible en tu idioma.

Social web community servers and apps can expose the wallet address of a user or post to a Web Monetization client, such as the Web Monetization browser extension or embedded SDK.

The monetization property from the Web Monetization namespace (https://webmonetization.org/ns.jsonld) applies to an Activity Streams 2.0 Object.

A Web Monetization wallet address may be applied to either an Actor performing an action of creation or an Object Type created by the Actor.

A monetization property must only be applied to an Object Type when its desired monetization attribution is distinct from the Actor who created it.

User profile example

{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",
{
"Hashtag": "as:Hashtag"
}
],
"id": "https://alpaca.gold/users/Jeremiah",
"type": "Person",
"following": "https://alpaca.gold/users/Jeremiah/following",
"followers": "https://alpaca.gold/users/Jeremiah/followers",
"inbox": "https://alpaca.gold/users/Jeremiah/inbox",
"outbox": "https://alpaca.gold/users/Jeremiah/outbox",
"preferredUsername": "Jeremiah",
"name": "Jeremiah Lee",
"summary": "<p>I want you to get paid when you go viral. <a href=\"https://alpaca.gold/tags/WebMonetizationRocks\" class=\"mention hashtag\" rel=\"tag\">#<span>WebMonetizationRocks</span></a></p>",
"url": "https://alpaca.gold/@Jeremiah",
"published": "2023-01-06T00:00:00Z",
"publicKey": {},
"endpoints": {
"sharedInbox": "https://alpaca.gold/inbox"
},
"tag": [{
"type": "Hashtag",
"href": "https://alpaca.gold/tags/WebMonetizationRocks",
"name": "#WebMonetizationRocks"
}],
// Wallet address when viewing this user’s profile and posts
"monetization": "https://fynbos.me/jeremiah"
}

User post (Note) example

{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://webmonetization.org/ns.jsonld",
// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",
{
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"conversation": "ostatus:conversation"
}
],
"id": "https://demo.interledger.social/users/WebMonetizationTest/statuses/113917664614618248",
"type": "Note",
"published": "2025-01-30T14:00:14Z",
"url": "https://demo.interledger.social/@WebMonetizationTest/113917664614618248",
"attributedTo": "https://demo.interledger.social/users/WebMonetizationTest",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": [
"https://demo.interledger.social/users/WebMonetizationTest/followers",
"https://alpaca.gold/users/Jeremiah"
],
"atomUri": "https://demo.interledger.social/users/WebMonetizationTest/statuses/113917664614618248",
"conversation": "tag:demo.interledger.social,2025-01-30:objectId=26:objectType=Conversation",
"content": "<p>“When you go viral, you should get paid.” —<span class=\"h-card\" translate=\"no\"><a href=\"https://alpaca.gold/@Jeremiah\" class=\"u-url mention\">@<span>Jeremiah</span></a></span></p>",
"contentMap": {
"en": "<p>“When you go viral, you should get paid.” —<span class=\"h-card\" translate=\"no\"><a href=\"https://alpaca.gold/@Jeremiah\" class=\"u-url mention\">@<span>Jeremiah</span></a></span></p>"
},
"tag": [{
"type": "Mention",
"href": "https://alpaca.gold/users/Jeremiah",
"name": "@[email protected]"
}],
// Wallet address distinct from the Note’s author
"monetization": "https://fynbos.me/jeremiah"
}

Post with multiple wallet addresses example

{
"@context": [
"https://www.w3.org/ns/activitystreams",
// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",
{
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"conversation": "ostatus:conversation",
"Hashtag": "as:Hashtag"
}
],
"id": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311",
"type": "Note",
"published": "2025-03-03T02:03:03Z",
"url": "https://alpaca.gold/@Jeremiah/816659822732776311",
"attributedTo": "https://alpaca.gold/users/Jeremiah",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": ["https://alpaca.gold/users/Jeremiah/followers"],
"atomUri": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311",
"conversation": "tag:alpaca.gold,2025-03-03:objectId=4838002:objectType=Conversation",
"content": "<p>I can’t take full credit for the awesomeness of this post.</p>",
"replies": {
"id": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies",
"type": "Collection",
"first": {
"type": "CollectionPage",
"next": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies?only_other_accounts=true&page=true",
"partOf": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies"
}
},
// Wallet address when viewing this Note
"monetization": ["https://fynbos.me/jeremiah", "https://fynbos.me/adam"]
}