vCon-JS Library
The TypeScript / JavaScript implementation of vCon, parallel to the Python library.
vcon-js is the TypeScript / JavaScript implementation of the vCon specification. It is a peer to the Python vcon library, targeting the same draft-ietf-vcon-vcon-core-02 spec.
Current version:
vcon-js0.4.0 Β· Install withnpm install vcon-jsΒ· GitHub: vcon-dev/vcon-js Β· Targetsdraft-ietf-vcon-vcon-core-02.
When to use vcon-js vs the Python library
vcon-js if you're writing Node services, Edge functions, Cloudflare Workers, browser code, or any TypeScript codebase that needs to read or write vCons.
Python
vconif you're writing data pipelines, ML preprocessing, or anything inside the conserver runtime.
The two libraries produce byte-compatible vCons. You can build with one and consume with the other.
Parity with the Python library
What you get in 0.4.0:
β Full core spec coverage:
Vcon,Party,Dialog,Attachment,Analysis,PartyHistoryβ Spec-correct field names:
amended(notappended),purposeon attachments,vcon: "0.4.0"syntax param set automaticallyβ External and inline media (
body+encodingorurl+content_hash)β Content hash validation (enforces
sha512-<base64url>format)β Auto-serialization:
addAnalysis({body: someObject, encoding: "json"})JSON-stringifies the body for youβ Generic extension declaration (
addExtension,addCriticalExtension)β Tags via
addTag(), with read-throughtagspropertyβ Per-class validators:
Dialog.validate(),Attachment.validate(),Party.validate(),PartyHistory.validate()
What's not in 0.4.0 yet (vs. Python vcon 0.9.4):
β Per-extension helpers. The Python library has
add_lawful_basis_attachment(),add_wtf_transcription_attachment(), andadd_wtf_transcription_analysis(); vcon-js exposes the genericaddAttachment/addAnalysisand you provide the extension shape yourself. The Extensions section shows what each one requires.β Built-in signing/encryption convenience. The Python lib wraps JWS/JWE via
sign()/verify()(RS256); in vcon-js thesignaturesandpayloadshapes are typed inVconDatabut you handle key management and signing throughjsonwebtokenor a similar peer dependency.β Extension-specific search helpers (
findLawfulBasisAttachments,findWtfAttachments). Filter the arrays manually for now.
Worked examples
The library ships three runnable TypeScript tutorials under examples/:
01-text-chat.tsβ multi-turn text chat with mixed-identifier parties, tags, serialization (npm run example:chat)02-call-recording.tsβ phone recording with external media, content hash, STIR validation, sentiment/transcription analysis, contact_center extension, party history (npm run example:call)03-video-conference.tsβ five-party video call, incomplete dialogs, multiple attachments, meeting series grouping, action-items analysis (npm run example:conference)
Documentation in this section
Quickstart β create a vCon, add parties and dialog, add an analysis, serialize.
API Reference β every exported class and method.
LLM Guide β paste this into a model's context window when you want it to generate vcon-js code.
See also
Python vCon Library β the peer implementation
Extensions β the shape of each extension, useful when you need to add extension data manually in vcon-js
Last updated
Was this helpful?