Understanding Member Data in Memberstack: Custom Fields, Metadata, and JSON

Article author
Memberstack Team

Memberstack provides three types of member data: Custom Fields, Metadata, and JSON. In addition to these, you can also access a member's email and password, but that is separate from these data types.

You can update JSON and Custom Fields using the frontend and backend API, through forms and data attributes in Webflow, and via the dashboard. However, Metadata can only be updated from the backend.

Custom Fields

Custom Fields are global key-value pairs that you can store across all members. When you create a custom field property, it becomes available to all members.

Screenshot__26_.png

Important: Custom fields have a limit of 100. We recommend using Member JSON for data that does not need to be shown to members.

For example, you can use custom fields to store data that you want every member to have, such as name and username.

Learn more about custom fields.

Metadata

Metadata is similar to custom fields as it can be used to store information about a member. However, there are a few key differences:

  • Metadata is read-only via the frontend.
  • Metadata can only be updated from the backend.
  • Metadata comes in key-value pairs.
  • Each member can have different sets of key-value pairs in their metadata.
  • Metadata is limited to 500 characters per member.

Screenshot__25_.png

For example, you can use metadata to store information that might vary across members, such as a set of external IDs collected from 3rd party integrations. Member 1 might have GitHub ID, Intercom ID, and Active Campaign ID, while Member 2 might have Instagram ID, Facebook ID, and Slack ID.

To retrieve the logged-in member's metadata, use the following code from our DOM package:

window.$memberstackDom.getCurrentMember().then(({ data : member }) => {
  if(member) {
    let metadata = member.metaData
    // Do stuff with logged-in member data here
  }
})

Member JSON

Member JSON allows you to store more complex data on a member. Unlike custom fields and metadata, JSON objects can be nested. Custom fields and metadata only accept boolean types (true/false), strings, and integers as valid values.

Screenshot__24_.png

For example, you can use JSON to achieve tasks similar to a database, such as storing a list of tweets published by a user or an array of member IDs added as friends. JSON is limited to 1MB per member.

To retrieve the logged-in member's JSON data, use the following code from our DOM package:

window.$memberstackDom.getMemberJSON();

To update the logged-in member's JSON data, use the following code from our DOM package:

window.$memberstackDom.updateMemberJSON({ 
  json: {
    "nickname": "https://www.media.com/buckets/nicolas/avatar.jpg"
  }
});

for an additional JSON information please read:
Using Member JSON Data with Memberstack's DOM Package

Was this article helpful?

Comments

7 comments

  • Comment author
    Daniel Valencia

    Please make an article on how to get the JSON of a member using the front-end JavaScript API. Thank you.

    7
  • Comment author
    Fredi Fdez

    It'd be awesome to have an article on how to access and update the User's Json via Webflow's script in the front-end. Thanks Team! 

    5
  • Comment author
    Jan Horubała

    Are you going to lift up limit for Member JSON? 5,000 characters is okey at the begging, but I'd like to keep more user data at memberstack side ;)

    3
  • Comment author
    Hugh Laverty

    In dire need of a guidance article here, specifically for accessing the JSON from a Webflow front-end. Thanks in advance 🙂

    2
  • Comment author
    Josh Lopez

    Hey William de Broucker 👋

    You should be able to update member metadata and json using the Memberstack Admin Package for REST 

    1
  • Comment author
    William de Broucker

    Hello, 

    I would like to know if I could update the metadata and / or the JSON via Make (via a http request) or Postman ? 

    Thanks

    William

    1
  • Comment author
    Josh Lopez
    • Edited

    Just updated the article. To get JSON data use: 

    window.$memberstackDom.getMemberJSON();

    You can read more in our DOM package docs

    1

Please sign in to leave a comment.