@eduzz/form-builder
v1.0.9
Published
Form builder viewer
Downloads
67
Keywords
Readme
Eduzz Form Builder
Form builder viewer
How to use
Generate a access token (Backend)
axios.post('https://formbuilder-api.eduzz.com/v1/auth/generate-access', {
"account": "your-account",
"secretKey": "your-secret-key",
"formRef": "form-ref",
"clientReference": "client-who-will-answer-ref",
"tags": ["some-tag"] // <~ optional
}, {
headers: { 'Accept': 'application/json', "Content-Type": "application/json" }
}
})
Via Browser
(function (d, l, c) {
var s = d.createElement('script');
s.async = true;
s.src = l;
s.onload = c;
d.body.append(s);
})(document, 'https://unpkg.com/@eduzz/form-builder@^1.0.0/build/widget.js', function () {
window.EduzzFormBuilder({
accessToken: "...",
element: document.getElementById('content'), // optional, if not provided a modal will be opened
onCompleted: (result, event) => { console.table({ event, result }) },
extra: { firstName: 'Teste', lastName: 'Form', email: '[email protected]' } // optional, only necessary for integration
});
});
Via npm
import EduzzFormBuilder from '@eduzz/apps-toolbar';
EduzzFormBuilder({
accessToken: "...",
element: document.getElementById('content'), // optional, if not provided a modal will be opened
onCompleted: (result, event) => { console.table({ event, result }) }
});