# In-App Message

{% hint style="info" %}
This feature is supported in React SDK version 11.15.0 and above.
{% endhint %}

{% hint style="info" %}
For details about In-App Message campaigns, refer to the [In-App Message](/en/crm-marketing/in-app-message-guide.md) guide.
{% endhint %}

## In-App Message Developer Guide

### Interfaces

#### HackleInAppMessage

```typescript
interface HackleInAppMessage {
  key: number
}
```

* Returns the key of the In-App Message.

#### HackleInAppMessageView

```typescript
interface HackleInAppMessageView {
  close(): void
  inAppMessage: HackleInAppMessage // 11.48.0+
}

```

* You can directly close the In-App Message from within a listener function by calling `close()`.

### Methods

#### getDisplayedInAppMessageView

```javascript
const hackleClient = createInstance("YOUR_SDK_KEY");

const view = hackleClient.getDisplayedInAppMessageView();
if (view !== null) {
  view.close(); // 현재 표시 중인 인앱메시지를 닫습니다.
}
```

* Returns the In-App Message currently displayed in the browser.
* The return type is `HackleInAppMessageView | null`.
  * Returns `null` if there is no currently displayed In-App Message.


---

# 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://docs.hackle.io/en/development-guide/react/in-app-message.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.
