UserVoice Node.js library for API connections
This library is designed to allow easy access to the UserVoice API for server side Node.js applications.
Current Status:
- Direct Client Key/Secret API calls can be made through the UserVoice Client
- Some helper functions have been exposed via UserVoice.Client.ticketService, ticketNoteService, assetService, etc
Installation
This SDK can be installed via NPM
npm i --save uservoice-nodejs
Examples
Direct Requests Against API
Direct requests can be made directly against the UserVoice client object using get
, post
, put
, and delete
.
Some API endpoints can be used without authentication, but most will require either owner-level or user-level authentication.
var UserVoice = ;var client = subdomain: 'subdomain' apiKey: 'clientKey' apiSecret: 'clientSecret'; // Login as ownerclient ; // Gets a list of all ticketsclient ;} // Requests can also be made against the V2 APIvar v2Client = clientId: 'apiKey' subdomain: 'subdomain'; var apiSecret = 'apiSecret';v2Client
API Abstractions
Some functions of the UserVoice API have been grouped into Objects and Functions for easier use. These functions have been designed to return promises, making them more composable in complex workflows.
var UserVoice = ;var client = subdomain: 'subdomain' apiKey: 'clientKey' apiSecret: 'clientSecret'; clientticketService ; // Against V2 APIvar clientv2 = subdomain: 'subdomain' apiKey: 'apiKey'; clientv2 ;
Contributing/Dev Environment
Getting Started
- npm install
Npm Tasks
- No global package installations should be necessary
- npm start: start TypeScript compiler with watch and incremental compilation
- npm run build: compile TypeScript, linter, and generator distributable type definitions
- npm test: run mocha tests
- npm run lint: run tslint
Versioning
This package is currently in a pre-release state; breaking changes may be made before 1.0.0 is released.
- Use npm version to bump version; npm version automatically creates a commit, make sure to push those changes
- Use Semantic Versioning
Publishing
- After running npm version and pushing/merging to master, run npm publish