---
updatedAt: 2025-05-19T20:52:57.000Z
agentTools:
  projectIndex: https://docs.arianee.org/llms.txt
---

# Send dMessage

```javascript JavaScript
const core = Core.fromRandom();

const creator = new Creator({
  creatorAddress: '0xDA03A1E7A19667445AE035C6B4DA148D5D128B95',
  core: core,
  transactionStrategy: 'DO_NOT_WAIT_TRANSACTION_RECEIPT',
});

const isConnected = await creator.connect('testnet');
if (isConnected) {
  await creator.utils.requestTestnetAria20();
  await creator.buyCredit(CreditType.message, 1);
  await creator.messages.createAndStoreMessage({
    smartAssetId: 12343,
    messageId: 1232143,
    content: {
      $schema: 'https://cert.arianee.org/version1/ArianeeMessage-i18n.json',
      title: 'Expand your collection with the Puppy collection!',
      content:
      'Are you a big fan of our other four-legged friends? Are you a cat or dog lover? Both? Just in time, we are launching the Puppy collection on our store with a wide range of colours!',
      pictures: [
        {
          mediaType: 'picture',
          type: 'product',
          url: 'https://documentation.arianee.com/pub/1670419418865-1632234657561-ROSE_BLEU_EMERAUDE_PURPLE.jpeg',
        },
      ],
    },
  });
}
```

# Core library

<!-- javascript@1 -->

Create an instance with Core library.

# Creator wallet

<!-- javascript@2-7 -->

Instanciate the wallet creator address.

# Connect to network

<!-- javascript@9 -->

Connect to your network.
In this case, the receiver digital passport is minted on testnet.

# Request $ARIA20 testnet

<!-- javascript@11 -->

You need $ARIA20 to buy Credits.

# Buy credits

<!-- javascript@12 -->

Buy Credits - message type - required to send a dMessage to a digital passport.

# Send dMessage method

<!-- javascript@13-29 -->

Send dMessage with required parameters:
- smartAssetId: receiver digital passport
- messageId (optional): ID of the dMessage about to be sent
- content: content of the dMessage