README
Chaka React SDK
Install
npm install --save @chakadev/react
or
yarn add @chakadev/react
Usage
import React from 'react';
import from './logo.svg';
import { ChakaApp } from '@chakadev/react';
import '@chakadev/react/dist/base.css';
function App() {
const bearerToken = `eh2TGXAkAO9U7c_740Z40NmjUuHrb4bfB5peHVKZF1H`;
const logo = 'http://mydomain.com/our-logo.png';
const closeModal = () => console.log('modal closed');
const showModal = true;
return (
<div className="App">
<ChakaApp
elementID={'#root'}
logoUrl={logo}
show={showModal}
token={bearerToken}
closeModal={closeModal}
/>
</div>
);
}
export default App;
Component Props
|Field | Type |Description | |--|--|--| |token | string | Bearer access token gotten from the backend | |elementID | string | id attached to an HTML node. i.e "#root" | |show| boolean | controls the triggering of the modal | |logoUrl | string | brand logo url for modal branding | | closeModal | function | call back function called after the modal is closed"
Contribution
How to setup the SDK; at the root of the project install dependencies by
yarn install
to compile the library as you are building at the project root folder run
npm start
see the project and include the library components, open another terminal and navigate to the docs folder and run
npm start
License
MIT © chakadev