Coder Social home page Coder Social logo

meteor-contextio's Introduction

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 
  • Setup cio credentials on your meteor project settings.json file.

Usage

  • Initialize cio:

    • Use singleton by setting up credentials on settings.json as the library looks for Meteor.settings.services.contextio. (read settings.example.json) var cio = Cio; //"Cio" is available globally
    • Or Manually create the client: var cio = ContextIOClient.get(apiKey,apiSecret);
  • 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: account account id to connect mailbox to.
    • optional: cio to specify wrapper to be used. defaults to singleton
    • optional: classes to override button style.
    • optional: callbackUrl to redirect client to after mailbox registration.
    • optional: label Button Label.

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.
  • Apps using this package (pull request to add more):

Testing

  • running examples: cd example/simple/ then meteor --settings settings.example.json
  • munit tests: meteor test-packages rapito:contextio --port 1234 --settings settings.example.json

Dependencies

meteor-contextio's People

Contributors

rapito avatar

Stargazers

Eric Yang avatar alan blount avatar Sid Tantia avatar Tony Blank avatar Gilberto Hernández avatar

Watchers

James Cloos avatar  avatar Tony Blank avatar

Forkers

soupala

meteor-contextio's Issues

TypeError: Cannot read property 'contextio' of undefined

Brand new Meteor app, first package, getting the following error output on server console:

(STDERR) /Users/admin/.meteor/packages/meteor-tool/.1.1.3.ufzkvm++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
(STDERR)                        throw(ex);
(STDERR)                              ^
(STDERR) TypeError: Cannot read property 'contextio' of undefined
(STDERR)     at Function.ContextIOClient.ContextIOClient.get (packages/rapito:contextio/server/lib/ContextIOClient.coffee:96:36)
(STDERR)     at __coffeescriptShare (packages/rapito:contextio/server/lib/ContextIOClient.coffee:103:23)
(STDERR)     at packages/rapito:contextio/server/lib/ContextIOClient.coffee:1:1
(STDERR)     at packages/rapito:contextio/both/lib/methods/ContextIOClient.coffee:1:1
(STDERR)     at /Development/xxxx/app/.meteor/local/build/programs/server/boot.js:222:10
(STDERR)     at Array.forEach (native)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.