> For the complete documentation index, see [llms.txt](https://developers.memberspace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.memberspace.com/javascript-api/guides/member-info-ssr.md).

# Getting Member Information - SSR

In Server Side Rendering scenarios where you have access to the whole DOM, you can subscribe to our custom [events](/javascript-api/overview/events.md) before the widget even starts to load. In this case there is no risk of missing the initial event(s).

```javascript
const handleReady = ({ detail }) => {
  // Your code
};        

document.addEventListener('MemberSpace.ready', handleReady);


const handleMemberInfo = ({ detail }) => {
  // Your code
};

document.addEventListener('MemberSpace.member.info', handleMemberInfo);


//MS install code ... Please see the relevant section
var MemberSpace = window.MemberSpace || {subdomain: "YOUR_SUBDOMAIN"};
(function(d){
  var s = d.createElement("script");
  s.src = "https://cdn.memberspace.com/scripts/widgets.js";
  var e = d.getElementsByTagName("script")[0];
  e.parentNode.insertBefore(s,e);
}(document));
```

{% hint style="info" %}
Please check out the [Install Code](/getting-started/install-code.md) section also.
{% endhint %}
