Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.08 KB

File metadata and controls

56 lines (40 loc) · 1.08 KB
sidebar_position 1

JavaScript / TypeScript Quickstart

Install

npm install @echomirror/core

Initialize the client

import { EchoMirrorClient } from '@echomirror/core'

const client = new EchoMirrorClient({
  apiKey: process.env.ECHOMIRROR_API_KEY,
})

Log a mood entry

import { logMood } from '@echomirror/mood'

const entry = await logMood(client, {
  mood: 'grateful',
  intensity: 8,
  note: 'Shipped a feature I am proud of',
})

console.log(entry.streak) // current mood-logging streak

Connect a Stellar wallet and send an echo

import { connectFreighter, sendEcho } from '@echomirror/stellar'

const wallet = await connectFreighter()

const transfer = await sendEcho(client, {
  from: wallet.publicKey,
  to: 'GRECIPIENT_PUBLIC_KEY',
  amount: '5',
  memo: 'thanks for the code review ??',
})

Next steps