Skip to content

Commit fa2c175

Browse files
committed
docs(readme): update README.md
1 parent e46b87a commit fa2c175

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

README.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,56 @@
1-
jotform-api-nodejs
2-
===============
3-
[JotForm API](https://api.jotform.com/docs/) - NodeJS Client
1+
<p align="center">
2+
<img src="https://www.jotform.com/resources/assets/logo-nb/jotform-logo-transparent-400x100.png" alt="logo" height="70">
3+
</p>
4+
<br />
5+
6+
# Jotform Node.js SDK
47

58
### Installation
69

710
```sh
811
$ npm install jotform
912
```
1013

11-
### Documentation
14+
#
1215

13-
You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)
16+
### Usage
1417

15-
### Authentication
18+
- Initialize the SDK.
1619

17-
JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.
20+
```ts
21+
import Jotform from "jotform";
1822

19-
### Examples
23+
const client = new Jotform('YOUR_API_KEY');
24+
```
2025

21-
```javascript
22-
var jotform = require("jotform")
26+
- Simple examples.
2327

24-
jotform.options({
25-
debug: true,
26-
apiKey: "YOUR_API_KEY"
27-
});
28+
```ts
29+
const response = await client.form.createForm();
30+
const formId = response.content.id;
31+
```
2832

29-
jotform.getUser()
30-
.then(function(r){
31-
/* successful response after request */
32-
})
33-
.fail(function(e){
34-
/* handle error */
35-
})
33+
```ts
34+
const questions = await client.form.addQuestions(formId, [
35+
{
36+
type: 'control_email',
37+
name: 'emailfield',
38+
text: 'My email field',
39+
order: '1'
40+
}, {
41+
type: 'control_email',
42+
name: 'emailfield2',
43+
text: 'My email field 2',
44+
order: '2'
45+
}
46+
]);
3647
```
3748

38-
See [Documentation](https://api.jotform.com) for full list of methods available.
49+
- Detailed information of API: [https://api.jotform.com/docs](https://api.jotform.com/docs).
50+
- Properties reference: [https://api.jotform.com/docs/properties/index.php](https://api.jotform.com/docs/properties/index.php)
51+
52+
#
53+
54+
### License
55+
56+
- This project is under the [GPLv2 license](LICENSE.md). Copyright (c) 2023 Jotform and it's contributors.

0 commit comments

Comments
 (0)