Static Sites & Locked Content

I’m creating an interactive book, and I’m authoring the content as a static site. I want to use Netlify to deploy the book, but I’m having a hard time figuring out how I can lock some chapters so that the user has to pay before they have access.

Netlify’s Role Based Access looks perfect, as it would allow me to handle the authentication with Netlify, then write my redirects based on JWT roles (which I could edit after receiving payment). The problem is that I can’t use this feature unless I shell out $1500/month (!!!) for a Business plan.

The only other solution I can think of would be to put a proxy in-front of the static site content and redirect requests based on authorization. It seems a shame to move a static site away from a CDN and serve it like that. I’m not even sure that I’d be able to do this with Netlify either.

I don’t want to gate the content on the client side, because the book is aimed at web developers, who will mostly find it trivial to bypass any Javascript based content restrictions.

I personally would recommend FaunaDB as it’s super easy to setup and (sorry Netlify) so much cheaper in terms of authentication, you only pay for lambda functions which communicate with the database (plus Fauna of course, but still it turns out much better). I’m not even sure if you can cover all the possible use cases of such mini app with pure Netlify features :thinking:

I’m likely to use FaunaDB in any version, to store payment details and users, but I don’t think that’s going to give me a better way to restrict access to the static content, right?

I did some quick research and indeed it looks like you gotta pay $1500 for the feature (edit: including tons of other features) :sob: However I’m trying to figure out atm if you could restrict access to direct calls but allow for Netlify functions via some API secret key. This would do the job and you could control access furthermore using FaunaDB.

If not, there always are 3rd party file storage services :man_shrugging:

hey there,

I wonder whether this topic might be covered in here:

1 Like