@saplingai/sapling-js 1.0.7-beta.0 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Benefits include:
|
|
|
17
17
|
- **Over 20 error types**: Error categories such as preposition, noun form, and verb tense, including both high-level and fine-grained error information.
|
|
18
18
|
- **Custom Models**: Get corrections and edits tuned to the domain of your text—for example academic writing vs. subtitles.
|
|
19
19
|
- **Enterprise Security**: Contact us for our no data retention policies, [self-hosted/on-premises](https://sapling.ai/onprem) deployment options, and other [cybersecurity policies and procedures](https://sapling.ai/security).
|
|
20
|
-
- **Rich Text Editor Support**: TinyMCE, CKEditor, QuillJS, Trix, ProseMirror, WordPress, Draft.js, Froala, Lexical and others.
|
|
20
|
+
- **Rich Text Editor Support**: TinyMCE, CKEditor, QuillJS, Trix, ProseMirror, WordPress, Draft.js, Froala, Lexical and others. Sapling's [HTML SDK](https://sapling.ai/docs/sdk/HTML/quickstart) can also be directly imported into HTML pages as JavaScript.
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
### Node.js
|
|
@@ -64,11 +64,25 @@ import { Client } from "@saplingai/sapling-js/client";
|
|
|
64
64
|
const apiKey = '<YOUR_API_KEY>';
|
|
65
65
|
const client = new Client(apiKey);
|
|
66
66
|
client
|
|
67
|
-
.edits('
|
|
67
|
+
.edits('I have a apple!')
|
|
68
68
|
.then(function (response) {
|
|
69
69
|
console.log(response.data);
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
+
// {
|
|
73
|
+
// edits: [
|
|
74
|
+
// {
|
|
75
|
+
// end: 8,
|
|
76
|
+
// error_type: 'R:DET:ART',
|
|
77
|
+
// general_error_type: 'Grammar',
|
|
78
|
+
// id: '740071c9-8ea3-583d-a86b-7ef80e5fc91e',
|
|
79
|
+
// replacement: 'an',
|
|
80
|
+
// sentence: 'I have a apple',
|
|
81
|
+
// sentence_start: 0,
|
|
82
|
+
// start: 7
|
|
83
|
+
// }
|
|
84
|
+
// ]
|
|
85
|
+
// }
|
|
72
86
|
```
|
|
73
87
|
|
|
74
88
|
|
|
@@ -77,7 +91,7 @@ Quickstart - Frontend
|
|
|
77
91
|
|
|
78
92
|
The SDK provides a way to automatically apply edit suggestions to any HTML contenteditable and textarea elements.
|
|
79
93
|
|
|
80
|
-
Do **not** serve a page like this publicly, as it exposes the API key. See documentation [Deploying to Production](https://sapling.ai/docs/sdk/
|
|
94
|
+
Do **not** serve a page like this publicly, as it exposes the API key. See documentation [Deploying to Production](https://sapling.ai/docs/sdk/JavaScript/frontend_documentation#deploying-to-production) for an example of setting up the API key with a separate backend environment.
|
|
81
95
|
|
|
82
96
|
```javscript
|
|
83
97
|
import { useEffect } from 'react';
|
package/package.json
CHANGED
package/sapling/observer.js
CHANGED