apptentive-sdk

JavaScript library for interacting with Apptentive.

Usage no npm install needed!

<script type="module">
  import apptentiveSdk from 'https://cdn.skypack.dev/apptentive-sdk';
</script>

README

Apptentive JavaScript SDK

Use Apptentive on the be.apptentive.com website.

Usage

# Setup
apptentive_api_token = '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
apptentiveSDK = new ApptentiveSDK(apptentive_api_token)

# Create a conversation with a person object:
apptentiveSDK.createConversation({ name: 'Matthew Callis', email: 'matthew@apptentive.com' })

# Send Apptentive Events
apptentiveSDK.createEvent('app.launch')

# Create a Message
apptentiveSDK.createMessage({
  message: {
    type: 'TextMessage',
    nonce: '1234567890matthew2',
    body: 'I would like more cats.',
    hidden: false,
    custom_data: {},
    client_created_at: Date.now(),
    client_created_at_utc_offset: 0
  }
})

Testing

npm run lint
npm run make
npm run instrument
npm test
npm run test-phantomjs
npm run coverage-report
npm run make-dist
npm run make-dist-min
# or
npm run make && npm run instrument && npm test && npm run test-phantomjs && npm run coverage-report && npm run make-dist && npm run make-dist-min

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request