Context.io - Meteor Package
** cio: short for Context.io
A lightweight toolkit to add support for Context.io to your Meteor App.
Includes:
- Wraps context.io node.js api client library ContextIO-node
- Utility methods for easy integration.
- UI controls to add cio accounts
- UI controls to associate cio mailboxes to cio accounts
If you are not yet familiar with Context.io, read their documentation first and play around a bit with their api explorer and make sure you understand how-it-works.
Disclaimer
Even though the package contains some utilities to make integration easier, it is still a wrapper of ContextIO-node which is still in beta (i think) so be sure to check it's documentation on it's own repo.
Installation
Simply add via console
meteor add rapito:contextio
Usage
Initialize cio:
- Use singleton by setting up credentials on settings.json as the library looks for
Meteor.settings.services.contextio. (readsettings.example.json)var cio = Cio.get(); - Or Manually create the client:
var cio = Cio.get(apiKey,apiSecret);
- Use singleton by setting up credentials on settings.json as the library looks for
Create cio accounts:
var userCioAccount = cio.createAccount(primaryEmailAddress,firstName,lastName);Connecting mailboxes:
Template.registerHelper('userCioAccount', function(){ return userCioAccount; });{{> connectMailboxButton account=userCioAccountId}}Use npm package directly:
var cioNode = cio.client;
Templates
- connectMailboxButton: Adds a Button which initiates negotiation to connect a new mailbox. (Hotmail or Gmail only)
- required:
accountaccount id to connect mailbox to. - optional:
cioto specify wrapper to be used. defaults to singleton - optional:
classesto override button style. - optional:
callbackUrlto redirect client to after mailbox registration. - optional:
labelButton Label.
- required:
Roadmap
- auto-sync meteor accounts: hook to create a user account on your cio account for each registered user.
Examples
- Check out the
examples/folder for simple use cases. - App using this package:
Testing
- running examples:
cd example/simple/thenmeteor --settings settings.example.json - munit tests:
meteor test-packages rapito:contextio --port 1234 --settings settings.example.json

Log in or sign up for Devpost to join the conversation.