---
title: "Life Ring Button API"
url: "https://help.productfruits.com/en/article/javascript-api-life-ring-button-v2"
language: "en"
last_updated: "2026-08-29T20:57:29.910Z"
---

# Life Ring Button API

Legacy

**Life Ring Button** is a legacy feature. For the current experience, see the [Elvin Widget](https://help.productfruits.com/en/article/how-to-edit-elvin) .

##   
Description

This JS API provides you access to the new Life Ring Button tool. Access methods on this object:

> `productFruits.api.inAppCenter`

## Methods

> `open(opts)`

Expands the Life Ring Button. It can receive an options object, see this example:

```plaintext
window.productFruits.api.inAppCenter.open({
	focus: { 
		articleId: 12345 // it will open the Life Ring Button focused to the particular article
	}
})
```

> `close()`

Closes the Life Ring Button.

> `isOpened()`

Returns `true` if the Life Ring Button is opened, `false` if it is not.

> `hide()`

Hides the whole button widget - the launcher button and the popup.

> `show()`

Shows the previously hidden button widget - the launcher button and the popup.

> `attachToCustomElement(elementInstance)`

Attaches the Life Ring to a custom element in your application. It automatically hides the default launcher button. The argument must be an element instance, not a CSS selector.

If you call only this function, the built-in launcher can be displayed for a second under some circumstances. To prevent the built-in launcher from being visible completely, use the `hideInAppCenterLauncher` configuration option set to `true` with the init script, as described [here](https://help.productfruits.com/en/article/custom-initialization-options).

> `listen(event, callback)`

Listens to a Life Ring Button event and calls the `callback`. Supported events are `closed` - this event is triggered when the Life Ring Button is closed; `opened` - triggered when the modal is opened.
