Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/traitify/traitify-js-client
https://github.com/traitify/traitify-js-client
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/traitify/traitify-js-client
- Owner: traitify
- Created: 2014-12-01T19:58:23.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T20:21:40.000Z (over 6 years ago)
- Last Synced: 2024-04-14T10:54:51.132Z (9 months ago)
- Language: CoffeeScript
- Size: 8.61 MB
- Stars: 2
- Watchers: 16
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Traitify.js
===============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).
### Assessment id and public key required!
For instructions on obtaining an assessment id and a public key visit:
[https://developer.traitify.com](https://developer.traitify.com)### Using The Latest and Greatest(Edge)!
For directions on using the latest traitify js scroll to the bottom### Using Traitify JS UI:
Include the Traitify.js library:```xhtml
```
The following javascript will initialize with the above html:
```HTMLTraitify.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```
===============
### Using Traitify JS API CLIENT:
```xhtml```
##### Get Decks
```JavaScript
Traitify.getDecks("assessment id").then(function(data){
console.log(data)
})
```##### Get Slides
```JavaScript
Traitify.getSlides("assessment id").then(function(data){
console.log(data)
})
```##### Add Slide
```JavaScript
Traitify.addSlide("assessment id").then(function(data){
console.log(data)
})
```##### Get Personality Traits
```JavaScript
Traitify.getPersonalityTraits("assessment id").then(function(data){
console.log(data)
})
```##### Get Personality Types
```JavaScript
Traitify.getPersonalityTypes("assessment id").then(function(data){
console.log(data)
})
```##### Get Personality Blend
```JavaScript
Traitify.get("/assessments/+"assessmentId+"?data=blend&image_pack=linear").then(function(data){
console.log(data)
})
```##### Get Careers
```JavaScript
Traitify.getCareers("assessment id", function(data){
console.log(data)
})
```##### Get Slides Using URL
```JavaScript
Traitify.get("/assessments/"+assessmentId+"/slides").then(function(data){
console.log(data)
})
```##### Get Slides With JSON CamelCase
```JavaScript
/* CamelCase instead of Underscore */
Traitify.setBeautify(true)
Traitify.getSlides(assessmentId).then(function(data){
console.log(data)
})
```### Using Edge
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.
```xhtml```
### Contributing
#### Building, Testing and Bundling:
```Shell
$ cake watch
$ cake build
$ cake bundle
$ cake test
```