@trevend/kit
v0.0.7
Published
JS- & React library to connect your app to Trevend.
Readme
Trevend JS & React library
Install
npm install --save @trevend/kitUsage
import { render } from 'react-dom';
import React from 'react';
import {
Provider,
useProduct,
} from '@trevend/kit';
function App() {
return (
<Provider storeUrl="https://yourStore.trevend.com" apiKey="YourAPiKey">
<div>
<h2>My first Trevend product 🚀</h2>
<Product />
</div>
</Provider>
);
}
function Product() {
const product = useProduct('IdOfYourFirstProduct');
return JSON.stringify(product);
}
render(<App />, document.getElementById('root'));Get an API key
Goto https://trevend.com and create a new account. Obtain an API key from the merchant backend.
Example app
https://docs.trevend.com/docs/example-app
Documentation
Check out the documentation at https://docs.trevend.com/
License
UNLICENSED © Trevend
