Jotform's Node.js SDK.
- First class TypeScript support.
- Promise based.
$ npm install jotform
- Initialize the SDK.
import { Jotform } from 'jotform';
const JF = new Jotform();
- Authenticate with Jotform.
JF.initializeSDK(
'your-api-key',
'Jotform Instance (US, EU or HIPAA - defaults to US)'
);
- Simple examples.
JF.user
.getUser()
.then((response: object) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
const data = {
questions: {
'1': {
type: 'control_head',
text: 'Text 1',
order: '1',
name: 'Header1',
},
'2': {
type: 'control_head',
text: 'Text 2',
order: '2',
name: 'Header2',
},
},
};
JF.form
.addNewQuestionToForm(formId, data)
.then((response: object) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
- Detailed information of API: https://api.jotform.com/docs.
- Properties reference: https://api.jotform.com/docs/properties/index.php
- This project is under the GPLv3 license. Copyright (c) 2021 Jotform and it's contributors.