# Reference

This topic is a reference for the Rebilly Cashier JavaScript library methods.

## RebillyCashier.renderDeposit()

Use this method to mount the Rebilly Cashier library UI components to the DOM of your website, and configure the experience for all your payment instrument methods.
This method returns a `Promise` and accepts a single `configuration` object.


```JavaScript
await RebillyCashier.renderDeposit({ cashierToken, mountElement });
```

### Mount configuration

| **Option**  | **Type** | **Description** |
|  --- | --- | --- |
| `cashierToken` | string | **Required.** Deposit request cashier token.
Returned from a [PostDepositRequest](https://www.rebilly.com/catalog/all/deposits/postdepositrequest#deposits/postdepositrequest/t=response&c=201&path=cashiertoken) as `cashierToken`. |
| `mountElement` | Query selector or `HTMLElement` | **Required.** [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) or a [query selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector#selectors) for the element into which the deposit form should be placed. |


### Example

Payment methods that are displayed in deposit forms are based on the gateway configuration.
For more information, see [Set up a payment gateway](/docs/settings/set-up-a-gateway).


```JavaScript
RebillyCashier.renderDeposit({
  cashierToken: "TOKEN",
  mountElement: '#deposit-form' // HTMLElement or query selector
});
```

## RebillyCashier.on()

Use this method to set up communication callbacks that trigger when certain events happen, such as `deposit-completed` and `payout-completed`.
This allows you to respond to cashier events and integrate with your application's workflow.
This method accepts a message type and a callback function.


```JavaScript
RebillyCashier.on('deposit-completed', (transaction) => {
  console.log('Deposit completed:', transaction);
  // Handle deposit completion event
});

RebillyCashier.on('payout-completed', (payoutRequest) => {
  console.log('Payout completed:', payoutRequest);
  // Handle payout completion event
});
```