Template Filling
The Template Filling SDK allows for the dynamic generation of documents from predefined templates with editable fields. This tool facilitates the automation of repetitive content such as contracts, forms, or letters by inserting specific data.
Integration Examplesβ
For the integration, it is necessary to have an <iframe id='iframeId'>
element where the SDK will be rendered, and the AucoSDK function must be provided with the ID of this element.
Follow the link to see the reference of the events required in an SDK integration: ππ» Events
Basic Integration, Regular Template Fillingβ
import { AucoSDK } from 'auco-sdk-integration';
const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'fill',
language: 'es', // Accepted languages ββ'es' | 'en'
keyPublic: 'puk_xxxxx', // Company public key
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
document: '67e714c96b3509c4bf2b44dd', // ID of the template to fill out
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});
Reference Integrationβ
Filling with a reference standardizes the validation and signature platform configuration and allows any user to create the process, which will be assigned to the company that owns the reference.
import { AucoSDK } from 'auco-sdk-integration';
const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'fill',
language: 'es', // Accepted languages ββ'es' | 'en'
keyPublic: 'puk_xxxxx', // Company public key
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
document: '67e714c96b3509c4bf2b44dd', // ID of the template to fill out
reference: 'R3F3R3NC3', // Reference
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});
Editing a Documentβ
Editing an already created document is only possible if the document has not been signed.
import { AucoSDK } from 'auco-sdk-integration';
const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'fill',
language: 'es', // Accepted languages ββ'es' | 'en'
keyPublic: 'puk_xxxxx', // Company public key
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
document: '67e714c96b3509c4bf2b44dd', // Template ID to fill
code: 'D0CC0D3', // Document code to edit
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});
Prefill Integrationβ
If the template to be filled already had prefilled fields at the time of creation, it is necessary to specify the code of the document created and indicate that it was prefilled.
import { AucoSDK } from 'auco-sdk-integration';
const unsubscribe = AucoSDK({
iframeId: 'iframeId',
sdkType: 'fill',
language: 'es', // Accepted languages ββ'es' | 'en'
keyPublic: 'puk_xxxxx', // Company public key
events: {
onSDKReady,
onSDKClose,
onSDKToken,
},
sdkData: {
document: '67e714c96b3509c4bf2b44dd', // Template ID to fill
code: 'D0CC0D3', // Prefilled document code
preBuild: true, // Tells the SDK to load the final part of the template
uxOptions: {
primaryColor: '#021c30',
alternateColor: '#a557f2',
},
},
env: process.env.PUBLIC_ENVIRONMENT == 'dev' ? 'DEV' : 'PROD',
});