1.0.1 • Published 3 years ago
@climes/client-sdk v1.0.1
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
idwhere the widget should be visible. Initialize client with the above
idwithurifrom server where the truecost call has to be made andoptInCallbackcallback 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-inFor eg: In a react based app, inside
App.jsadd auseEffectimport { 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
makeTruecostCallfunction with the required arguments to get truecost.
Contact Us
To integrate Climes-SDK in your product, visit us at Climes