Any good and complete sample code to use unlock-protocol?

Hi.

I’m new to unlock-protocol and I find the tech very promising! However, I’m having trouble programmatically putting all the unlock-protocol building blocks together. I find the existing documentation on the docs.unlock-protocol.com site a little too piecemeal (very few full working examples) to successfully implement unlock. Is there any simple barebones/boilerplate sample code that you can point me to that does the following programmatically using javascript/react:

  1. Create my own paywall page similar to the paywall.unlock-protocol.com
  2. Create a Lock just like you would using the unlock-protocol dashboard
  3. Display list of members just like on the unlock-protocol dashboard

My response will be in two comments since it only lets me add two links per comment.

First, thanks for asking and we appreciate the feedback!

We recognized this as an issue and have been working toward improvements with lots coming this month that will fill in most of the gaps. In the meantime, there are a few example repos that you might find helpful.

This repo has all of the things on your list, plus everything available in the scaffold-eth repo.

This is a very simple react app using the paywall

2 Likes

This repo has examples of both client and server-side locking and uses Next.js

I would suggest you also follow this repository which hasn’t been updated in some time but I will be doing that in the next few days and again as I start dropping more and updated code examples throughout the month of August. It also has links to some of the integrations which is another good source of code examples.

2 Likes

Good LORD almighty, why aren’t any of these links easily found in the Unlock documentation??

Thank you for this info, it looks really helpful! I’m going to dig into it. And I’m really looking forward to all your August updates!!

2 Likes