@salsa-payroll/salsa-js
v0.3.0
Published
Salsa Js
Keywords
Readme
Salsa.js
This package allows you to leverage our Salsa.js script by importing it into your project.
Installation
Use npm to install this module;
npm install @salsa-payroll/salsa-jsUsage - loadSalsaJs
This function is the entry point which returns a Promise<Salsa>. Once resolved you will have
an instance of Salsa that you can then use as per our documentation
In a plain old javascript project
import { loadSalsaJs } from '@salsa-payroll/salsa-js';
const salsa = await loadSalsaJs('ck_your-client-key');In React
import { loadSalsaJs } from '@salsa-payroll/salsa-js';
const [salsa, setSalsa] = useState();
useEffect(() => {
loadSalsaJs('ck_your-client-key', { env: 'sandbox' }).then((salsaJs) =>
setSalsa(salsaJs),
);
}, []);You can try this directly in our Example Frontend Application
ESModule vs CommonJS
We are currently only exposing ES Module. In the future we may choose to support exporting as CommonJs
