Subscribe to content

In this example, we demonstrate how to manage subscription-based access to content using the OneEntry API. We check if a user has an active subscription and either grant access to premium content or prompt them to subscribe.

✅ Purpose of the scenario:
  • Only users with a subscription have access to the content
  • The check is based on Orders, User.
  • Those who are not authorized or have not purchased will receive an offer to subscribe.
✅ What you need:
  • A valid PROJECT_URL and APP_TOKEN for authentication with the OneEntry API.
  • Form with marker "subscriptions", attributes "expired_date" and "subscription_time" and type "Order form"
  • Registered user
📌 Important:
  • These examples do not include error handling.
  • You can manage errors using a try-catch block or by employing a construction like await Promise.catch((error) => error).
Loading sandbox…