Library to provide simple application functionality like authentication and local/session/token storage for Tesselate applications.
npm install kyper-matter






> What are the minimal tools I need to make an app matter?
Matter is a Javascript library that provides common web application functionality such as user authentication and local/session/token storage. This library is built to communicate with a Tessellate Server such as Tessellate for application data, but custom server setups are on the roadmap.
Matter is Isomorphic, which means it will work well in both Browser and NodeJS environments. ES6 functionality is also available through importing and/or extending Matter (more details below).
Using Matter requires having created an application on Build, Tessellate or on your own Tessellate server.
#### CDN
To use the CDN, add the following script tag to your index.html:
``html`
bower install --save kyper-matter
#### Bower
Run
2. Start using Matter by providing the name of the app you created on Build or Tessellate:
`javascript`
//New Matter object with the application name 'exampleApp'
var matter = new Matter('exampleApp');
`
3. Start using Matter:javascript`
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then(function(user){
console.log('User logged into exampleApp:', user);
});
2. Import Matter library
`javascript
import Matter from 'kyper-matter';
`
3. Create a new matter application object:
`javascript
//New matter object with the application name 'exampleApp'
let matter = new Matter('exampleApp');
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then((user) => {
console.log('User logged into exampleApp:', user);
}, (err) => {
console.error('Error logging in:', err);
});
`
4. Use Matter methods$3
1. Run npm install --save kyper-matter
2. Import Matter library
`javascript
var Matter = require('kyper-matter');
`
3. Create a new matter application object:
`javascript
//New matter object with the application name 'exampleApp'
var matter = new Matter('exampleApp');
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then(function(user) {
console.log('User logged into exampleApp:', user);
}, function(err) {
console.error('Error logging in:', err);
});
`Options
When creating a new matter object, you can provide an options object as the second argument:`javascript
//New matter object with the application name 'exampleApp'
var optionsObj = {
localServer: false,
logLevel: 'trace'
}
var matter = new Matter('exampleApp', optionsObj);
`
Availble options:
* logLevel - Level of logging (error, warn, info, debug, or trace)
* localServer - Boolean of whether or not to use local tessellate server
Docs
$3
$3
More Information
For more details please visit the Matter Wiki.Test
Tests are located in test folder and can be run via
gulp test or gulp coverage commands.index.html has been added as a bare bones test page similar to browser example (/examples/browser/index.html).