|
1 | 1 | # @superdoc-dev/esign |
2 | 2 |
|
3 | | -React component that wraps SuperDoc for document signing workflows with audit trails and compliance tracking. |
| 3 | +> **This repository has been deprecated and moved to the SuperDoc monorepo.** |
4 | 4 |
|
5 | | -## Installation |
| 5 | +## New Location |
6 | 6 |
|
7 | | -```bash |
8 | | -npm install @superdoc-dev/esign |
9 | | -``` |
10 | | - |
11 | | -## Quick Start |
12 | | - |
13 | | -```jsx |
14 | | -import React from 'react'; |
15 | | -import SuperDocESign from '@superdoc-dev/esign'; |
16 | | -import 'superdoc/dist/style.css'; |
17 | | - |
18 | | -function App() { |
19 | | - const handleSubmit = async (data) => { |
20 | | - // Send to your backend |
21 | | - await fetch('/api/sign', { |
22 | | - method: 'POST', |
23 | | - headers: { 'Content-Type': 'application/json' }, |
24 | | - body: JSON.stringify(data) |
25 | | - }); |
26 | | - alert('Document signed!'); |
27 | | - }; |
| 7 | +The SuperDoc eSign package is now part of the main SuperDoc monorepo: |
28 | 8 |
|
29 | | - return ( |
30 | | - <SuperDocESign |
31 | | - eventId={`session-${Date.now()}`} |
32 | | - |
33 | | - document={{ |
34 | | - source: "https://storage.googleapis.com/public_static_hosting/public_demo_docs/service_agreement.docx", |
35 | | - validation: { scroll: { required: true } } |
36 | | - }} |
37 | | - |
38 | | - fields={{ |
39 | | - document: [ |
40 | | - { id: '1', value: 'John Doe' }, |
41 | | - { id: '2', value: new Date().toLocaleDateString() }, |
42 | | - { id: '3', value: 'SuperDoc' }, |
43 | | - { id: '4', value: 'Premium' }, |
44 | | - { id: '5', value: 'CA' }, |
45 | | - { id: '6', value: '123 Main St, Anytown, USA' } |
46 | | - ], |
47 | | - signer: [ |
48 | | - { |
49 | | - id: '7', |
50 | | - type: 'signature', |
51 | | - validation: { required: true }, |
52 | | - label: 'Type your full name' |
53 | | - }, |
54 | | - { |
55 | | - id: '8', |
56 | | - type: 'checkbox', |
57 | | - validation: { required: true }, |
58 | | - label: 'I accept the terms' |
59 | | - } |
60 | | - ] |
61 | | - }} |
62 | | - |
63 | | - onSubmit={handleSubmit} |
64 | | - /> |
65 | | - ); |
66 | | -} |
67 | | -``` |
| 9 | +- **Source**: [github.com/superdoc-dev/superdoc/tree/main/packages/esign](https://github.com/superdoc-dev/superdoc/tree/main/packages/esign) |
| 10 | +- **npm**: [@superdoc-dev/esign](https://www.npmjs.com/package/@superdoc-dev/esign) |
| 11 | +- **Docs**: [docs.superdoc.dev/solutions/esign](https://docs.superdoc.dev/solutions/esign) |
68 | 12 |
|
69 | | -## Backend - Create Signed PDF |
| 13 | +## Migration |
70 | 14 |
|
71 | | -Use the SuperDoc API to create the final signed document: |
| 15 | +No changes are required for existing users. The npm package name remains the same: |
72 | 16 |
|
73 | | -```javascript |
74 | | -// Node.js/Express |
75 | | -app.post('/api/sign', async (req, res) => { |
76 | | - const { eventId, auditTrail, documentFields, signerFields } = req.body; |
77 | | - |
78 | | - // 1. Fill document fields |
79 | | - const annotated = await fetch('https://api.superdoc.dev/v1/annotate', { |
80 | | - method: 'POST', |
81 | | - headers: { |
82 | | - 'Authorization': `Bearer ${API_KEY}`, |
83 | | - 'Content-Type': 'application/json' |
84 | | - }, |
85 | | - body: JSON.stringify({ |
86 | | - document: 'template.docx', |
87 | | - fields: [...documentFields, ...signerFields] |
88 | | - }) |
89 | | - }); |
90 | | - |
91 | | - // 2. Add digital signature |
92 | | - const signed = await fetch('https://api.superdoc.dev/v1/sign', { |
93 | | - method: 'POST', |
94 | | - headers: { |
95 | | - 'Authorization': `Bearer ${API_KEY}`, |
96 | | - 'Content-Type': 'application/json' |
97 | | - }, |
98 | | - body: JSON.stringify({ |
99 | | - document: await annotated.blob(), |
100 | | - auditTrail: auditTrail |
101 | | - }) |
102 | | - }); |
103 | | - |
104 | | - // 3. Save PDF |
105 | | - await saveToStorage(await signed.blob(), `signed_${eventId}.pdf`); |
106 | | - |
107 | | - res.json({ success: true }); |
108 | | -}); |
| 17 | +```bash |
| 18 | +npm install @superdoc-dev/esign |
109 | 19 | ``` |
110 | 20 |
|
111 | | -See [Python, Node.js, and more examples](https://docs.superdoc.dev/solutions/esign/backend). |
112 | | - |
113 | | -## What You Receive |
114 | | - |
115 | | -```javascript |
116 | | -{ |
117 | | - eventId: "session-123", |
118 | | - timestamp: "2024-01-15T10:30:00Z", |
119 | | - duration: 45000, |
120 | | - documentFields: [ |
121 | | - { id: "1", value: "John Doe" } |
122 | | - ], |
123 | | - signerFields: [ |
124 | | - { id: "7", value: "John Doe" }, |
125 | | - { id: "8", value: true } |
126 | | - ], |
127 | | - auditTrail: [ |
128 | | - { type: "ready", timestamp: "..." }, |
129 | | - { type: "scroll", timestamp: "..." }, |
130 | | - { type: "field_change", timestamp: "..." }, |
131 | | - { type: "submit", timestamp: "..." } |
132 | | - ], |
133 | | - isFullyCompleted: true |
134 | | -} |
135 | | -``` |
| 21 | +## Contributing |
136 | 22 |
|
137 | | -## Documentation |
| 23 | +Please open issues and pull requests in the main SuperDoc repository: |
138 | 24 |
|
139 | | -Full docs at [docs.superdoc.dev/solutions/esign](https://docs.superdoc.dev/solutions/esign) |
| 25 | +https://github.com/superdoc-dev/superdoc |
140 | 26 |
|
141 | | -## License |
| 27 | +--- |
142 | 28 |
|
143 | | -AGPLv3 |
| 29 | +This repository is archived and no longer maintained. |
0 commit comments