Advice and answers from the MemberSpace Team

Javascript Hook Instructions

Warning: This guide is for people comfortable with Javascript programming.

We provide the ability for you to access the currently logged in member so that you can further customize your site. Common use cases include displaying certain elements if a member is logged in, pre fill forms with a member's information, and displaying personalized messages.

To use the javascript hook start by placing this code on your website:

  (function() {
    MemberSpace.onReady = MemberSpace.onReady || [];
    MemberSpace.onReady.push(function(args) {
      if (args.member) {
        // Your custom code goes here

The member object data structure will be as follows:

    id: [integer],
    name: [string],
    firstName: [string],
    lastName: [string],
    email: [string],
    plans: [array],
    failedCard: [boolean]

Property Descriptions


The member's unique identifier.


Simply a string combination of the first and last name of the member.


A string of the members first name.


A string of the members last name.


A string of the members email address.


The plans array is a list of plan names the member is actively subscribed to.


The failedCard boolean indicates if the customer currently has a failed payment.

Did this answer your question?