@avss-tech/esign-sdk
v1.0.4
Published
Official Node.js SDK for AVSS eSign API
Downloads
42
Readme
AVSS eSign SDK
Official Node.js SDK for AVSS eSign platform - A comprehensive e-signature solution for digital document signing.
Features
- 🚀 Easy Integration: Simple API for sending, managing, and tracking e-signature documents
- 📄 Document Management: Send documents, templates, and track signing status
- 🔐 Secure: Built with security best practices and API key authentication
- 📱 TypeScript Support: Full TypeScript definitions for better developer experience
- ⚡ Fast: Lightweight and optimized for performance
Installation
npm i @avss-tech/esign-sdkQuick Start
import { AvssEsign } from "avss-esign-sdk"
// Initialize the SDK
const esign = new AvssEsign({
apiKey: "sk_your_api_key_here",
baseURL: "https://api-saas-esign.avsstech.in" // optional
})
// Send a document for signing
const result = await esign.documents.send({
file: "./path/to/document.pdf",
name: "Loan Agreement",
description: "Loan agreement document",
signers: [
{
name: "John Doe",
email: "[email protected]",
phone: "+1234567890"
signatureDetail: [
{
"page": 1,
"coordinates": [
{
"x": 449,
"y": 273,
"w": 200,
"h": 100
}
]
}
]
}
],
signingOrder: "sequential",
message: "Please review and sign this agreement"
})
console.log(result)API Reference
Initialization
const esign = new AvssEsign({
apiKey: string, // Required: Your API key
baseURL?: string, // Optional: API base URL (defaults to production)
timeout?: number // Optional: Request timeout in ms (default: 30000)
})Documents API
Send Document
await esign.documents.send(options: SendDocumentOptions)Parameters:
file: Path to the PDF documentname: Document namedescription?: Document descriptionsigners: Array of signer objectssigningOrder?: "parallel" | "sequential"message?: Message to signers
List Documents
await esign.documents.list(page?: number, limit?: number)Get Document
await esign.documents.get(documentId: string)Get Document Status
await esign.documents.status(documentId: string)Download Document
await esign.documents.download(documentId: string)Send from Template
payload = {
"signers": [
{
"name": "Test1",
"email": "[email protected]",
"phone": "9876000000"
},
{
"name": "Test2",
"email": "[email protected]",
"phone": "9876000000"
}
],
"signingOrder": "sequential",
"livePhoto": true,
}
await esign.documents.sendFromTemplate(templateId: string, payload: any)Examples
Send Document with Multiple Signers
const esign = new AvssEsign({ apiKey: "sk_xxx" })
const result = await esign.documents.send({
file: "./contract.pdf",
name: "Service Agreement",
signers: [
{
name: "Alice Johnson",
email: "[email protected]",
phone: "+1987654321"
signatureDetail: [
{
"page": 1,
"coordinates": [
{
"x": 449,
"y": 273,
"w": 200,
"h": 100
}
]
}
]
},
{
name: "Bob Smith",
email: "[email protected]",
phone: "+1123456789"
signatureDetail: [
{
"page": 1,
"coordinates": [
{
"x": 449,
"y": 273,
"w": 200,
"h": 100
}
]
}
]
}
],
signingOrder: "sequential"
})List and Download Documents
// List documents
const documents = await esign.documents.list(1, 20)
// Get specific document
const doc = await esign.documents.get("doc_123")
// Check status
const status = await esign.documents.status("doc_123")
// Download signed document
const signedDoc = await esign.documents.download("doc_123")Error Handling
try {
const result = await esign.documents.send(documentOptions)
} catch (error) {
if (error.statusCode === 401) {
console.log("Invalid API key")
} else if (error.statusCode === 400) {
console.log("Invalid request:", error.message)
} else {
console.log("API error:", error.message)
}
}Requirements
- Node.js >= 14.0.0
- npm or yarn
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
MIT License - see LICENSE file for details.
Support
- 📧 Email: [email protected]
- 📚 Documentation: https://docs.avsstech.in
- 🐛 Issues: GitHub Issues
Made with ❤️ by AVSS Tech
