1. Initializing the Embedded Experience
To initialize the Tight Embedded experience in your project, follow the instructions on Embedding Tight’s white-labelled UI.2. Render the form of a specific transaction
To render a specific transaction overlay form, you will need to provide anelementId parameter, which is the HTML id of the main <div> where you would like the form to render from. The form will be styled with the CSS property “position: fixed”, so it can be overlayed on top of your existing UI. When your user selects a CTA to view the form, you simply need to invoke the following line of JavaScript:
entity parameter to specify the type of the transaction. An entityId is also required. These parameters are described in the following table:
📘 Rendering the form for an accountant If you’re rendering the Transaction Form for an accountant (i.e. you’ve initialized Tight Embedded for an accountant), you will additionally need to specify theuserIdfor the client that the given transaction belongs to. The numericuserIdcan be obtained from the accountant users endpoint.
3. Reacting to user actions
After rendering a form, the user can review or edit the transaction as needed. If you’d like to display your own UI before a user opens or after closing a form, you will want to take advantage of the Tight Embedded experience’sregisterTransactionFormListener functionality. By registering a listener, the provided callback function will be invoked with the data of the rendered transaction and the result of the form submission.
To register a listener, simply add the following line of JS to be ran once after Hurdlr.renderTransactionForm(...):
myTransactionFormCallback will be invoked with a JSON object as the single argument, containing the following attributes.
Example arguments for a
myTransactionFormCallback invocation when rendering an Expense form is shown below.