@climes/client-sdk
v1.0.1
Published
### Installation
Downloads
2
Readme
Climes Client SDK
Installation
npm install @climes/client-sdk
How to use
Make sure @climes/server-sdk is installed before proceeding further
Designate a tag with an
id
where the widget should be visible.Initialize client with the above
id
withuri
from server where the truecost call has to be made andoptInCallback
callback in the starting point of your projectid: Target ID uri: target API URI from server for truecost call optInCallback: callback to take action on Climes opt-in
For eg: In a react based app, inside
App.js
add auseEffect
import { initialize } from '@climes/client-sdk'; function App() { //... useEffect(() => { initialize({ id: 'my-climes', uri: 'http://localhost:4000/api/truecost', optInCallback: (e) => { console.log(e.target.checked); } }); }, []); //... }
In the page where the widget is added, call
makeTruecostCall
function with the required arguments to get truecost.
Contact Us
To integrate Climes-SDK in your product, visit us at Climes