How to fetch plan ID and plan type for authenticated users with custom code in Memberstack? Answered Josef Eines May 27, 2023 15:25 7 comments How can i get planID of current logged in user with custom JS? Comments 7 comments Sort by Date Votes Yannick Caron May 28, 2023 00:57 window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0].id)}) 0 Josef Eines May 28, 2023 00:57 you rock! 0 Yannick Caron May 28, 2023 00:57 You can try something like this! Don't know if this works for your use case specifically, but if I run this in the console, it logs the plan id. 0 Josef Eines May 28, 2023 00:57 Yannick Caron, gonna test now b looks like it work, but i think i need to get plan type (free/paid) and write to console You know any way to do this? Trying to build a custom script, but need to figure out if user is on paid plan or free plan first 0 Yannick Caron May 28, 2023 00:57 window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0].type)}) window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0])}) If u use this one you can see all properties you can access regarding your users' plans window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data)}) This one gives you access to all data that is available from users. 0 Josef Eines May 28, 2023 00:57 works like a charm Yannick thanks bro 0 Yannick Caron May 28, 2023 00:57 No problem! 0 Please sign in to leave a comment.
Comments
7 comments
window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0].id)})you rock!
You can try something like this!
Don't know if this works for your use case specifically, but if I run this in the console, it logs the plan id.
Yannick Caron, gonna test now b
looks like it work, but i think i need to get plan type (free/paid) and write to console
You know any way to do this?
Trying to build a custom script, but need to figure out if user is on paid plan or free plan first
window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0].type)})window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0])})If u use this one you can see all properties you can access regarding your users' plans
window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data)})works like a charm Yannick
thanks bro
No problem!
Please sign in to leave a comment.