0.0.7 • Published 4 years ago
@trevend/kit v0.0.7
Trevend JS & React library
Install
npm install --save @trevend/kit
Usage
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