@bkbarry-lateral/tm-connector
v0.0.47
Published
Before using the LateralWrapper, you need to initialize the library with your API key:
Downloads
99
Readme
Initialization
Before using the LateralWrapper, you need to initialize the library with your API key:
import { initLateral } from "tailormade-headless";
initLateral({
apiKey: "YOUR_API_KEY",
userId: "CURRENT_USER_ID",
});Usage
import { LateralWrapper } from 'tailormade-headless';
...
<LateralWrapper lateralLocationId={componentIdConfiguredInLateral}>
<div>
<h1>My content</h1>
<p data-lateral-field-id={idConfiguredInLateral}>Default text if backend is not reachable</p>
</div>
</LateralWrapper>Development
To develop this package locally and test it in tailormade-fe, use Yalc:
Install Yalc globally (if not already installed):
npm install -g yalcFrom the root of the project, run:
yalc publishIn the
tailormade-fedirectory, run:yalc add @bkbarry-lateral/tm-connectorWhen you make changes to this package, run the following in this directory:
yalc push --scripts --update --replace --sigThis will build the package and update all projects using it via Yalc.
When you're done developing and want to switch back to the npm version, go to the
tailormade-fedirectory and run:yalc remove @bkbarry-lateral/tm-connector npm install
