How to remove members related JS

I have members enabled without stripe.
How can I make ghost not to load stripe related scripts and requests?
Also how could I make ghost not load /public/members.js?

1 Like

There’s no way to currently disable that! We should deffo not add in the stripe scripts unless they’re going to be used though - I can understand that.

What is the reason for not wanting to load /public/members.js?

I wrote my own “members.js”. The included one does not fit my UI. It presumes my UI uses certain classes or that I should write that css/dom stucture to fit the code in members.js

Also, why some requests are made to api endpoints like /ghost/api/canary/members/send-magic-link/ and another request is made to non api endpoint /members/ssr?

Ah that’s not recommended right now - the API we’ve exposed by using data-members-* attributes is the documented and official way of interacting with the members feature from the frontend - if you circumvent this, the underlying structure can/probably will change.

Out of interest which bits in particular do not fit your UI? Members does not require you to use certain classes, just needs data attributes added to the relevant elements.

Some of the requests are made to the API because they are API specific, for example creating members/stripe sessions. The requests made to the frontend are frontend specific, usually concerning the session. Though these endpoints are undocumented and should not be considered stable for developing against!