1.1.4 • Published 11 years ago
supportive-js v1.1.4
Supportive.js
A vanilla, dependency-free browser JS library for the Supportive.io API.
Read the full documentation here.
Install
Via bower:
bower install --save supportive-jsVia npm:
npm install --save supportive-jsVia Download:
Quick Start
<script type="application/javascript" src="<path_to_supportive_js>/supportive.js"></script>var support = new Supportive( 'your_app_id', 'your_api_token' );var user = {
identifier : 'ashheskes',
email : 'ash@supportive.io',
name : 'Ash Heskes',
custom_data :
{
test : true
}
};
support. init( user, function( error, user, messages ) {
if ( error ) return alert( ':( Something went wrong!' );
/* do stuff... */
} );support. on( 'message', function( message ) {
/* do stuff... */
} );support. once ( 'init', function ( ) {
support. send( 'Feedback!', 'I love your App.', { page : 'home' }, function( error, message ) {
if ( error ) return alert( ':( Something went wrong!' );
/* do stuff... */
} );
} );