# Appendix II: MetaMembership Contract Access

The membership contract is an opportunity to store data in a way that is not as traceable is NFT ownership and is controlled by the owner of the contract and therefore cannot be transferred. In addition, relevant non-PII metadata can be stored in the entry for quick retrieval.

## Methods

### addMembership(address customerAddress, string memory metadata)

This method creates an entry associated with the caller of the contract that is attributed to the customerAddress. If the entry already exists, this will override the metadata stored associated with the entry.

<pre class="language-javascript" data-overflow="wrap"><code class="lang-javascript"><strong>const tx = await contract.addMembership(ethAddress); //returns transaction information
</strong></code></pre>

### removeMembership(address customerAddress)

For an existing member, this will revoke their membership, expunging the entry for future requests in the entry associated with the calling address.

{% code overflow="wrap" %}

```javascript
const tx = await contract. removeMembership(ethAddress);  //returns transaction information
```

{% endcode %}

#### confirmMembership(address publisherAddress, address customerAddress)

This checks for a customerAddress entry associated with the membership owner’s public key, defined by publisherAddress. Unlike add/remove, this can be open to anyone or accessed by authorized partners defined by the owner of the contract.

{% code overflow="wrap" %}

```javascript
const tx = await contract. confirmMembership(ethAddress); //returns boolean result
```

{% endcode %}

#### getMembershipMetadata(address publisherAddress,address customerAddress)

For members, this method will retrieve the metadata that was stored by customerAddress associated with a member with the public key customerAddress. Like confirmMembership, this is accessible to all authorized callers as defined by the contract owner.

{% code overflow="wrap" %}

```javascript
const tx = await contract. getMembershipMetadata(ethAddress);  //returns metadata string
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.credenza3.com/credenza-sdk-v5.0/appendix-ii-metamembership-contract-access.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
