How to fetch plan ID and plan type for authenticated users with custom code in Memberstack? Josef Eines asked May 27, 2023 15:25 Answered How can i get planID of current logged in user with custom JS? 7 comments Sort by Date Votes Yannick Caron · May 28, 2023 00:57 Comment options window.$memberstackDom.getCurrentMember().then((member) => {console.log(member.data.planConnections[0].id)}) Upvote this reply 0 Downvote this reply Reply Copy link Josef Eines OP · May 28, 2023 00:57 Comment options you rock! Upvote this reply 0 Downvote this reply Reply Copy link Yannick Caron · May 28, 2023 00:57 Comment options 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. Upvote this reply 0 Downvote this reply Reply Copy link Josef Eines OP · May 28, 2023 00:57 Comment options 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 Upvote this reply 0 Downvote this reply Reply Copy link Yannick Caron · May 28, 2023 00:57 Comment options 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. Upvote this reply 0 Downvote this reply Reply Copy link Josef Eines OP · May 28, 2023 00:57 Comment options works like a charm Yannick thanks bro Upvote this reply 0 Downvote this reply Reply Copy link Yannick Caron · May 28, 2023 00:57 Comment options No problem! Upvote this reply 0 Downvote this reply Reply Copy link Please sign in to leave a comment.
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.