---
schema_version: "1"
id: 86a23f9797e9843892a8ba3baa62e5eb1a8ee6a27cf66bf72146cc2a6c702f0d
title: sendMessage()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/container/container-npm-sendmessage.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/container-npm-sendmessage.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1259be23609ebd9bc893eb0ad9d3d06416ec2a5fe4767837f3d5ccfb2ec36548
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# sendMessage()

Sends a message from the framed JavaScript code to the Aura component.

## Sample

Used within a JavaScript app uploaded as a static resource and referenced by `lightning:container`, this example sends a message from the app to `lightning:container`.

```javascript
sendMessage() {
  LCC.sendMessage({name: "General", value: this.state.messageToSend});
}
```

## Arguments

|Name|Type|Description|
|----|----|-----------|
|`userMsg`|any|While the data sent in the message is entirely under your control, by convention it’s an object with name and value fields.|

## Response

None.

