> 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/overview/functions.md).

# Functions

{% hint style="warning" %}
These functions can be used anywhere in your custom code, but **you need to make sure the MemberSpace widget is loaded and ready**.

We suggest that you use them only from within an [event](/javascript-api/overview/events.md) handler or once the [MemberSpace.onReady flag](/javascript-api/overview/flags.md#memberspace-ready) is set. There is an [example code](/javascript-api/guides/member-info-spa.md#single-page-apps) with a promise interface that can help delay executing your code until the widget is ready.

In case of async functions, if an error occurs the promise will get rejected. Please make sure to handle promise rejection in your code!
{% endhint %}
