> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/en/development-guide/javascript/in-app-message.md).

# In-App Message

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

## In-App Message Developer Guide

#### 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/en/development-guide/javascript/in-app-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
