bookingbug-core-js
v1.51.1
Published
Bookingbug model layer
Downloads
147
Readme
Bookingbug model layer.
npm install --save bookingbug-core-js
Loading options:
- Default ES modules
import {BBModel, BBServcie, context} from 'bookingbug-core-js';
- ES5 build for node (CommonJS)
const {BBModel, BBServcie, context} = require('bookingbug-core-js/build/bb-core.node.commonjs');
- ES5 build for web (CommonJS)
const {BBModel, BBServcie, context} = require('bookingbug-core-js/build/bb-core.web.commonjs');
import {BBModel, BBServcie, context} from 'bookingbug-core-js/build/bb-core.web.commonjs';
- ES5 build for web (window.bbCore)
<script type="application/javascript" src="./bookingbug-core-js/build/bb-core.web.window.js"></script>
Example with ES5 build for web (CommonJS)
import {BBModel, BBServcie, context} from 'bookingbug-core-js/build/bb-core.web.commonjs';
// set api url
context.apiUrl = 'https://your.server';
// decide if you want to enable | disable push notifications
context.pusher.enabled = false;
const loginCredentials = {
email: 'an@email',
password: 'pass'
};
BBService.adminLogin.login(loginCredentials)
.then((user) => {
user.$getAdministrators().then((administrators) => console.log(administrators));
})
.catch((err) => console.log('Invalid server, user or password', err));
Example with ES5 build for web (window.bbCore)
<script type="application/javascript" src="./bookingbug-core-js/build/bb-core.web.window.js"></script>
<script type="application/javascript" >
// set api url
bbCore.context.apiUrl = 'https://your.server';
// decide if you want to enable | disable push notifications
bbCore.context.pusher.enabled = false;
const loginCredentials = {
email: 'an@email',
password: 'pass'
};
bbCore.BBService.adminLogin.login(loginCredentials)
.then((user) => {
user.$getAdministrators().then((administrators) => console.log(administrators));
})
.catch((err) => console.log('Invalid server, user or password', err));
</script>