chekin-sdk
v0.3.8
Published
SDK for Chekin online
Downloads
20
Readme
Chekin SDK Client
FOR CHEKIN PRO MUST BE VERSION 0.3.2 FOR NEW GUESAPP VERSION 2.0.0 (IMPROVE)
The objective of this project, its build a sdk where our customers can connect with chekin API and implement our checkin process in their sites.
This project it's only a temporary starter project, all the files, functions, dependencies etc., could be change to improve the code and the functionality of the project
Chekin SDK is a software development kit that allows us to consume api methods for the implementation of the check-in process in third-party sites
Features
- Get reservation info from reservation ID
- Creation of guest in reservation
- Get Booking Details (to develop)
- Identity verification process (to develop)
- Get locations
- Creation of reservation
Dev dependencies
- [js-cookie] - for storing data in cookies.
- [Babel] - to transpile javascript to es6.
- [webpack] - to generate builds for library usage.
- [Typescript] - for development.
- [refresh-fetch] - To keep a valid token authorize request (temporary, we will change the auth process)
- [dayjs] - To work with dates
And of course Dillinger itself is open source with a [public repository][dill] on GitHub.
Installation
Chekin sdk requires Node.js v10+ to run.
Install the dependencies and devDependencies and start the server.
cd chekin-sdk
yarn install
Project structure
|-- lib //bundles and test file
| |-- Chekin.amd.js
| |-- Chekin.amd.js.map
| |-- Chekin.amd.min.js
| |-- Chekin.amd.min.js.map
| |-- Chekin.js
| |-- Chekin.js.map
| |-- Chekin.min.js
| |-- Chekin.min.js.map
| `-- basic.html // this file is for test the library in a plain HTML
|-- src
| |-- auth // Whit this files we are going temporally make the authentication process
| | |-- index.ts
| | `-- refreshFetch.ts
| |-- utils
| | `-- resolver.ts
| |-- constants.ts
| |-- index.ts //main file, there is where are the SDK methos, this could be improve
| |-- types.ts // types of the project
| `-- validations.ts // generic validations
|-- types // types generate with tsc
| |-- Chekin.amd.d.ts
| |-- Chekin.amd.min.d.ts
| |-- Chekin.d.ts
| `-- Chekin.min.d.ts
|-- README.md
|-- package.json
|-- tsconfig.json
|-- webpack.config.ts
Build
yarn build:production //check package json
Run and Test
IMPORTANT
before run the commands, generate token in our guestapp chekin, and paste it the class client in the index.ts, line 15
currentToken="YOUR NEW TOKEN"
this is for keep authenticated while send request from the sdk, this is temporally, the authentication process will be development with a clientId in the future for the backend
yarn build:production //build bundles
yarn run:test // run locally the project
Build types for bundle
yarn build-type
Open localhost:3000, click lib folder, and then, click basic.html
The first time you test the project, you will need run locally the project, then, with the local server running, each time you want to test the new changes, you only have to run the build command, a reloading the page.
Run tests
Before we need to set manually TOKEN in src/constants file
CURRENT_TOKEN="YOUR NEW TOKEN"
then:
yarn test