Sapling Logo

Grammar Checking in JavaScript


JavaScript is a scripting language used in browsers to provide client-side dynamic application behavior. Almost all websites use it. Additionally, JavaScript is also used in server-side applications through environments like Node.js. Cross-platform and desktop applications can be developed using the Electron framework.

Sapling: AI Writing Assistant

With Sapling, you can add grammar or spell checking functionality to an existing JavaScript application.

This page demonstrates a quick way to integrate grammar and spell checking functionality into a JavaScript application using Sapling's API. If you are not looking for a JavaScript guide, click here for guides for other programming languages.

Sapling maintains a JavaScript specific SDK that you can view documentation for here, but you can also access the Sapling Grammar Checking HTTP API using any programming language that supports HTTP POST requests.

Setup Steps

JavaScript Grammar Check Quickstart

HTML / JavaScript

<script src=""></script>

<div contenteditable="true" id="check-space" sapling-ignore="true">Lets get started!</div>

<script type="text/javascript">
  key: '<API_KEY>',
  endpointHostname: '',
  editPathname: '/api/v1/edits',
  statusBadge: true,
  mode: 'dev',

const contentEditable = document.getElementById('check-space');

Node.js / JavaScript

  npm install saplingai/sapling-js
import { Client } from "@saplingai/sapling-js/client";

const apiKey = '<API_KEY>';
const client = new Client(apiKey);
  .edits('Lets get started!')
  .then(function (response) {

Returned result:

          "sentence":"Lets get started!",


Addtional parameters and Sapling's full API documentation can be accessed here: