tumblr / docs

Tumblr's public platform documentation.
Apache License 2.0
109 stars 27 forks source link

NPF spec: document `paywall` content block type #61

Open AprilSylph opened 3 years ago

AprilSylph commented 3 years ago

I understand that Post+ is still in beta, but it would be nice to acknowledge its existence for completeness' sake. It would also be helpful to (eventually) explain how clients are expected to link to creators, since the block content itself contains no hints.

(Examples below for my own and others' reference in lieu of actual documentation)


const { response: { content } } = await window.tumblr.apiFetch('/v2/blog/cyle/posts/661343283814039552');
[
  {
    "type": "text",
    "text": "special spooky bonus 35mm photo of Bilbo under the fold for my silly post+ supporters... proof ghosts are real"
  },
  {
    "type": "paywall",
    "subtype": "cta",
    "title": "For Supporters",
    "text": "Support %s by subscribing to their +Posts. As a supporter you'll get access to exclusive content and perks.",
    "isVisible": true
  }
]

const { response: { content } } = await window.tumblr.apiFetch('/v2/blog/frogwhomp/posts/662969493785542657');
[
  {
    "type": "text",
    "text": " youll never guess.............. what amazing thing............ lies beneath "
  },
  {
    "type": "paywall",
    "subtype": "disabled",
    "title": "Ahh shucks!",
    "text": "%s is no longer offering Post+ subscriptions, and this content isn't available for you to see 🙈.",
    "isVisible": true
  }
]
cyle commented 3 years ago

I understand that Post+ is still in beta, but it would be nice to acknowledge its existence for completeness' sake.

Thanks for pointing this out! We'll be adding the paywall parts of the spec to the public docs. It was indeed not here yet because it's in beta and therefore somewhat in flux -- but it's pretty solid now that we're in Open Beta territory. We'll ping here when that's been merged.

It would also be helpful to (eventually) explain how clients are expected to link to creators, since the block content itself contains no hints.

Totally, good call. Right now the expected behavior was assumed to be: just link to the blog page (i.e. cyle.tumblr.com). But we can certainly add some kind of intended URL destination to the paywall block for explicitness sake, as that URL is actually different depending on the platform you're consuming it from (and we may want to change it eventually, instead of having it be an assumption).