1.0.1 • Published 7 years ago

attendease v1.0.1

Weekly downloads
60
License
-
Repository
github
Last release
7 years ago

attendease-js

Official JavaScript/Node SDK for Attendease.

npm version build status npm downloads dependency status

Installation

Install with bower or npm (recommended).

$ npm install attendease

Getting Started

If in Node or using a CommonJS style loader, simply require the module and initialize a client.

var attendease = require('attendease')
var client = attendease('your-event-subdomain')

If in the browser, attendease-js occupies an Attendease global that you can use to initialize a client.

var client = Attendease('your-event-subdomain')

Overview

All methods on the client object return a promise. A then callback must be chained onto the call in order to then do something with the result.

Authentication

// authenticate as an attendee
client.login({
  email: 'user@example.com',
  password: 'password'
}).then(function(response) {
  ...
})

// get user details
client.user().then(function(userDetails) {
  ...
})

// logout
client.logout().then(function() {
  ...
})

Read API

// fetch event details
client.event().then(function(eventDetails) {
  ...
})

// fetch presenters
client.presenters().then(function(presenters) {
  ...
})

// fetch sessions
client.sessions().then(function(sessions) {
  ...
})

// fetch sessions mapped out as instances
client.instances().then(function(instances) {
  ...
})

// fetch rooms
client.rooms().then(function(rooms) {
  ...
})

// fetch venues
client.venues().then(function(venues) {
  ...
})

// fetch filters
client.filters().then(function(filters) {
  ...
})

// fetch schedule statuses
client.scheduleStatuses().then(function(statuses) {
  ...
})

// get status for a particular instance
client.scheduleStatus(instanceId).then(function(status) {
  ...
})

Write API

// like an item
client.like(presenterId, 'presenter').then(function() {
  ...
})

// unlike an item
client.unlike(likeId).then(function() {
  ...
})

// rate an item
client.rate(sessionId, 'session', 4).then(function() {
  ...
})

// schedule an instance
client.schedule(instanceId).then(function() {
  ...
})

// unschedule an instance
client.unschedule(instanceId).then(function() {
  ...
})

// check-in to the event
client.checkin('event').then(function() {
  ...
})

// check-in to a session instance
client.checkin('instance', instanceId).then(function() {
  ...
})

// undo a check-in to the event
client.undoCheckin('event').then(function() {
  ...
})

// undo a check-in to a session instance
client.undoCheckin('instance', instanceId).then(function() {
  ...
})

Caching

If you wish to perform caching on all resources, specify the performCaching option when initializing a client.

var client = attendease('your-event-subdomain', {
  performCaching: true
})

With caching enabled, all subsequent calls to any read API methods will resolve right away with a cached version of the previous request for that resource. Example:

// first call will perform a request and cache the data
client.presenters().then(function(presenters) {
  ...
})

// subsequent calls after will not make a request, will return cached result
client.presenters().then(function(presenters) {
  ...
})

// pass true to the call to make a request and update the cache (sync)
client.presenters(true).then(function(presenters) {
  ...
})

Building and testing

Make sure you install any development dependencies.

npm install

Build the library into ./dist.

npm run build

Or to have webpack watch files for changes and do builds automatically.

npm run watch

And to run the test suite.

npm test
1.0.1

7 years ago

1.0.0

9 years ago

0.5.0

9 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.4

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago