Sapling Logo

Grammar Checking in Typescript


TypeScript is a strongly-typed programming language that transpiles into JavaScript. It is a superset or extension of JavaScript and adds optional static typing functionality. The language is developed and maintained by Microsoft.

Sapling: AI Writing Assistant

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

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

Sapling maintains a Typescript 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

Typescript Grammar Check Quickstart

HTML / Typescript

<script src=""></script>
<div contenteditable="true" id="check-space"></div>

<script type="text/javascript">
  endpointHostname: "",
  editPathname: "/api/edits",
  completePathname: "/api/complete",
  autocomplete: true,
  statusBadge: true,

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

Node.js / Typescript

  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: