This package does not require jQuery, as it is a standalone encapsulated library. It does however require a browser with the ability to make cors requests (currently only supports ie8 and up, chrome, safari, and firefox).
For instructions on obtaining an assessment id and a public key visit: https://developer.traitify.com
For directions on using the latest traitify js scroll to the bottom
Include the Traitify.js library:
<script src="https://cdn.traitify.com/lib/v1.js"></script>
The following javascript will initialize with the above html:
<script>
Traitify.setPublicKey("8asdf8sda-f98as-df8ads-fadsf"); // Example Public Key
Traitify.setHost("api-sandbox.traitify.com"); // Example host url (Defaults to api.traitify.com)
Traitify.setVersion("v1"); // Example Version
var assessmentId = "34aeraw23-3a43a32-234a34as42"; // Example Assessment id
</script>
===============
<script src="https://cdn.traitify.com/lib/v1.js"></script>
Traitify.getDecks("assessment id").then(function(data){
console.log(data)
})
Traitify.getSlides("assessment id").then(function(data){
console.log(data)
})
Traitify.addSlide("assessment id").then(function(data){
console.log(data)
})
Traitify.getPersonalityTraits("assessment id").then(function(data){
console.log(data)
})
Traitify.getPersonalityTypes("assessment id").then(function(data){
console.log(data)
})
Traitify.get("/assessments/+"assessmentId+"?data=blend&image_pack=linear").then(function(data){
console.log(data)
})
Traitify.getCareers("assessment id", function(data){
console.log(data)
})
Traitify.get("/assessments/"+assessmentId+"/slides").then(function(data){
console.log(data)
})
/* CamelCase instead of Underscore */
Traitify.setBeautify(true)
Traitify.getSlides(assessmentId).then(function(data){
console.log(data)
})
Warning, things may break if you use edge, it is not stable, and is not intended to be. If you're looking for a stable deployment then use the v1 bundle from the above cdn.
<script src="https://cdn.traitify.com/lib/edge.js"></script>
$ cake watch
$ cake build
$ cake bundle
$ cake test