Vanilla Javascript
Javascript SDK for Lehjah embedded accounting.
Installation
NPM Installation
You can install the Lehjah package via npm:
Usage
After installing the package, you can embed the Lehjah accounting view in your web application:
Script Installation via HTML
Alternatively, you can include the Lehjah widget directly in your HTML page using the script from unpkg.com:
Configuration Parameters
When initializing the Lehjah widget, you need to provide a configuration object with the following parameters:
-
business_id: (required)
The unique ID of the business on your platform for which the accounting view is being embedded. -
public_key: (required)
The developer API public key associated with your account. You can obtain this key from your account on Lehjah. -
token: (optional - required for data sync with platform only)
The authentication token of the user’s active session on your platform. This token is used to synchronize user data based on the configuration set up in your Lehjah account. -
environment: (optional, default: ‘production’)
Specifies the environment to be used. This can be eithersandbox
orproduction
. For access to these environments, please contact us at developer@lehjah.com. -
target_id: (required)
The ID of the HTML element where the Lehjah widget will be embedded.
Example
In this example, the Lehjah widget will be embedded within the div
with the ID lehjah-accounting
. You can set the height to 100vh so as have a full height display.