So I’ve been waiting for decoupled membership functionality (API) for quite some time, but since it’s not yet ready, I decided to go around this.
Here’s the current plan:
I’m using Gatsby for frontend + Netlify Identity for authentication
When somebody wants to become a member and clicks on ‘Become a member’ I redirect them to members.mysite.com where customized Ghost Casper theme is shown. I don’t need to redesign the entire theme, I’ll just need to style a few pages involved in setting up membership.
Once they sign up, I retrieve members from Ghost DB and update my Netlify DB used for membership on the main site with Gatsby.
One thing though that I’m worried about is whether I’ll be able to somehow get the list of all members from Ghost to sync them with Netlify Identity.
I tried to set up membership with Ghost but since Stripe is the only supported payment option which is not available in my country I couldn’t make this work. So instead I set up Patreon profile and added Zapier integration with Ghost so that when a new member is added/updated/deleted on Patreon this is reflected in my Ghost membership instance.
Now I need to figure out what to do with authentication. I would rather use Ghost auth service instead of Netlify’s Identity but I’m not sure how to distinguish between users (editors, writers etc.) and members. Is there any documentation on this or where can I find the information? This doc describes the flow related to users. Is it also applicable to membership feature? I checked DB structure and there are different tables users and members so I’m not sure how auth handles members.
If there’s no way to use Ghost’s auth service for members, I’m thinking about retrieving all members from Ghost using admin API from inside Netlify’s lambda function. Although the API is not public, it exists and works. I can then use a webhook on Ghost when a new member is added to trigger the function and update Netlify’s Identity users list.
I think the latter option might be better for your use case. However, as you’ve discovered, the API related to members does work but is not publicly documented. This is because Members is still a beta feature, and is still in active development. Please bear this in mind when working with Ghost as a headless CMS and Members (beta)