Home/Articles/Developer Resources
JavaScript Embed

Elvity JavaScript Embed: The Developer's Shortcut to AI Contract Intelligence

Stop building custom contract parsers. Elvity's JavaScript embed gives your application enterprise-grade contract extraction — a drop-in widget, a structured JSON response, and a human review queue — integrated in hours, not months.

7 min read·Developer Resources

Building a contract importer properly is a multi-month engineering project. You need to handle diverse file sources, parse legal language that never follows a consistent schema, manage a validation queue for ambiguous clauses, and do all of it inside a security architecture that won't fail a SOC 2 audit. Most teams underestimate that scope by a factor of ten.

Elvity's JavaScript embed packages that entire problem — solved — into an embeddable widget and a clean API. Your application gets the output: structured contract data, ready to write to your database. Elvity handles everything in between.

The Ingestion Pipeline

Every document that enters via the embed follows the same four-stage pipeline. Each stage runs automatically; the only moment a human is involved is when the AI surfaces a clause it's uncertain about.

How the Elvity embed pipeline works

File Upload

Drag-drop, Drive, SharePoint

AI Extraction

Semantic clause parsing

Human Review

Low-confidence flagging

Structured JSON

Into your database

What the Elvity Embed Includes

1. The Drop-In Ingest Widget

Elvity ships a fully built, white-labeled upload UI that you embed into your application. Your users get a world-class import experience; you write zero frontend upload code.

  • Bulk drag-and-drop — thousands of files processed in a single session
  • Direct cloud connectors — import straight from Google Drive, SharePoint, and Dropbox without a download/re-upload loop
  • Real-time progress — document-level status streamed as the AI processes each file
  • Fully themeable — colours, typography, and logo match your product, not Elvity's

2. Instant Metadata Extraction

The moment a document lands, Elvity's AI reads it as a legal document — not as a text file. It identifies the parties, dates, financial terms, renewal triggers, liability clauses, and governing law, then returns all of it as structured JSON. No regex. No template mapping. No post-processing script.

The response includes confidence scoring at the field level, so your application knows which values are certain and which should be surfaced for user confirmation.

Elvity embed response — structured contract data

contractData
{
  "document_id": "doc_8f2a91c",
  "status": "extracted",
  "confidence": 0.97,
  "parties": {
    "client": "Acme Corp",
    "vendor": "SaaS Provider Ltd"
  },
  "effective_date": "2024-01-15",
  "termination_date": "2026-01-14",
  "auto_renewal": true,
  "renewal_notice_days": 60,
  "liability_cap": 500000,
  "governing_law": "Delaware",
  "clauses": {
    "termination": "Either party may terminate...",
    "indemnity": "Vendor shall indemnify..."
  },
  "flags": []
}

3. Human-in-the-Loop Validation

Legal data doesn't tolerate silent errors. When Elvity's confidence on a specific clause drops below your configured threshold, it surfaces that clause in a built-in review interface — inside your application, without redirecting users to an external tool. Your users review, correct if needed, and confirm before the data commits.

The result is a system that's fully automated on straightforward documents and gracefully assisted on the edge cases — not a system that silently lets bad data through.

Built for Developers

The embed initialises in three steps: load the script, drop a target element, call Elvity.embed(). The widget opens, handles the upload experience, runs the pipeline, and calls your onSuccess callback with structured data. The complexity lives inside Elvity; your integration code stays clean.

Embed in seconds

index.html
<!-- 1. Load the Elvity embed script -->
<script src="https://cdn.elvity.com/embed.js"></script>

<!-- 2. Drop the mount point anywhere in your page -->
<div id="import-widget"></div>

<!-- 3. Initialise -->
<script>
  Elvity.embed({
    token:  'tkn_YOUR_TOKEN',
    target: '#import-widget',
    onSuccess: (contractData) => {
      // contractData is fully structured JSON
      saveToDatabase(contractData);
    },
    config: {
      extractClauses: ['Termination', 'Indemnity', 'AutoRenewal'],
      theme:        'light'  // or 'dark' to match your app
    }
  });
</script>

Everything Else You'd Have to Build

Beyond the widget and extraction, Elvity ships the infrastructure that every serious integration eventually needs:

RESTful API

Clean, versioned endpoints for server-side processing. Full OpenAPI spec included.

Webhooks

Get notified the instant AI extraction completes — no polling required.

White-label UI

The ingest widget matches your brand. Custom colours, logo, and copy.

SOC 2 & GDPR

Enterprise-grade security built into every request. No audit exceptions.

Bulk processing

Thousands of documents in parallel. Progress streaming via WebSocket.

Cloud connectors

Direct import from Google Drive, SharePoint, Dropbox — no download/re-upload loop.

Where Teams Are Using the Embed

ERPs & CRMs

Pull structured contract data directly into vendor or customer records. Parties, dates, and renewal triggers land exactly where your team already works.

Procurement Portals

Automatically validate incoming vendor agreements against your standard clause library. Flag deviations before legal review, not after signature.

M&A Data Rooms

Audit thousands of target company contracts during due diligence in hours, not weeks. Risk flags and missing terms surfaced automatically.

The Build vs. Integrate Decision

The "just build it internally" path is tempting until you scope it properly. A production-grade contract ingestion layer — one that handles diverse file sources, semantic legal extraction, validation workflows, and enterprise security requirements — is a dedicated engineering effort measured in quarters, not sprints. And it's not your core product.

The embed lets your team skip that build entirely. You get the same extraction quality that Elvity has spent years tuning on real legal documents, available from your first script tag. For the full picture of what a purpose-built ingestion layer covers, see 5 Critical Considerations When Building a Contract Data Ingestion Engine.

The Bottom Line

Every engineering hour spent building contract parsing infrastructure is an hour not spent on your core product. Elvity's JavaScript embed removes that trade-off. Your users get a seamless import experience and accurate structured data; your team ships what they're actually there to build.

The embed handles the contract data problem. You handle the product.

Request a developer sandbox

Get a token, a sandbox environment, and access to the full embed documentation. Talk to an integration engineer about your specific use case.