API Reference

Displays different information to users based on whether they have a subscription or not. You can use this to gate content on your website behind a subscription.

Place content you want your subscribers to see in the available slot (i.e. player links, transcripts, etc.) and content for everyone else in the unavailable slot (i.e. a sign up prompt, a login button)

<supercast-gate> relies on your users Supercast login state. Generally users who signed up will have a persistent cookie and will be logged in, but we recommend including a Login button (using Supercast.startLogin or Supercast.login) in the unavailable slot or elsewhere on your page so that users can authenticate if they are on a different device.

Note: This only prevents display of information to non-subscribers, and it will still be present in your HTML source. We do not recommend using this for sensitive information.

Syntax:

<supercast-gate>
  <div slot="available">
    Content for subscribers
  </div>
  <div slot="unavailable">
    Content for non-subscribers
  </div>
</supercast-gate>

Attributes:

  • required-plans (optional) - Which plans the user needs to see the content. This is a comma-delimited list of plan ids. If omitted, any active subscription to the channel will allow viewing the content. If you do limit subscribers based on plans, you can add an additional plan-required slot that will display when users do have a subscription, but don't have the required plan available (otherwise we'll default to the unavailable slot)