apptentive-sdk
v1.3.0
Published
JavaScript library for interacting with Apptentive.
Downloads
3
Maintainers
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: '[email protected]' })
# 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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request