Quickstart Guide

The JalpiForm Javascript SDK is a zero-dependency, headless rendering engine. Attach a verified dynamic form straight onto any generic HTML site by importing a singular tag.

1. Script Injection

Paste the CDN resolver straight into your DOM's <head> or <body> fragment.

HTML (Versioned v1 Integration)
<script data-id="YOUR_FORM_ID" src="https://form.jalpi.com/js/v1/sdk.js"></script>

Advanced Initialization

For more control, load the core logic and initialize the AuthyoForm prototype manually. Target any <div> element using a CSS selector.

Javascript (v1 Logic)
<script src="https://form.jalpi.com/sdk/v1/form.js"></script>
<script>
  window.addEventListener('load', function() {
    AuthyoForm.init({
      formId: 'abcdef1234',
      baseUrl: 'https://form.jalpi.com',
      container: '#my-form-container',
      onSubmit: function(data) { console.log('Submitted:', data); }
    });
  });
</script>

Layout & Styling

You can easily adjust the form's Width, Height, and Alignment by wrapping the container in a standard HTML <div> with custom CSS. Here is a working example of a centered, fixed-width form:

HTML + CSS Wrapper
<!-- Wrapper to control Layout -->
<div style="max-width: 600px; margin: 50px auto; min-width: 320px;">
   <div id="my-form-container"></div>
</div>

<script src="https://form.jalpi.com/js/sdk.js" data-id="YOUR_FORM_ID"></script>

Note: The form is responsive by default and will automatically shrink to fit mobile screens if the wrapper's max-width is exceeded.

Enhanced OTP Security

If the JSON Schema possesses a verifyOtp: true flag inside Email or Phone objects, the SDK intercepts the submission. JalpiForm's infrastructure handles all OTP verification tokens automatically, and you can configure the following security parameters in the Builder:

  • OTP Length: Configure between 4 to 9 digits for precise security requirements.
  • Expirations: Scale expiration windows from 1 to 60 minutes for balanced UX and security.
  • Resend Delay: Enforce mandatory wait periods (up to 6000 seconds) to prevent SMS spam.
  • Skip Verification: Allow "Skip Verification" toggles for soft-gated conversions.
Billing Warning: OTP transmissions are billed per delivery attempt. Ensure your Dashboard Wallet maintains higher than zero credit.

Domain Whitelisting & Referrer Security

To prevent unauthorized sites from "stealing" your form configurations, you can enable **Domain Security** in the JalpiForm Dashboard. Once configured, our backend enforces a strict Referrer check.

Security Logic: When a domain is whitelisted, the Form schema will explicitly refuse to load on any origin that does not match your approved list, returning an HTTP 403 Forbidden response.

Phone Component Country Selection

The Phone component now supports granular country logic. By default, all 240+ countries are enabled, but you can restrict this in the builder to specific markets (e.g., "Gulf Countries" or "All Asia").

Auto-Filtering: If a user's IP belongs to a restricted country, the SDK natively handles the country list visibility for a seamless UX.

Error Diagnostics

The JalpiForm SDK returns strict REST standards upon validation failure logic scenarios. Evaluate HTTP Code triggers natively.

Code Reason Phrase Diagnostic Action
400 Missing Schema formId token maps to a deleted or non-existent structural JSON configuration.
401 Unauthorized Token The OTP challenge verification resolved invalid or expired. Check Authyo logs.
402 Insufficient Funds The Wallet Ledger plummeted to zero. Purchase bulk credits or manipulate Admin Margin ratios.
429 Too Many Requests Rate limiting policy breached. We enforce thresholds (e.g., 10 OTPs/30 mins/IP) to prevent abuse.
500 Integration Error Upstream constraints breached. Report internal server crashes directly onto Support channels.