Get started

Sapling API/SDK Textarea Demo

See Sapling's grammar, spelling, and autocomplete suggestions, plus AI content detection, running live in a <textarea>, powered by the JavaScript SDK below.

Add it to your page

Drop this snippet into any page to get the same live suggestions and AI detection shown above.

index.html
<script src="https://sapling.ai/static/js/sapling-sdk-v1.1.3.min.js"></script>
<textarea id="editable"></textarea>
<button id="ai-detect-btn">Check for AI</button>

<script type="text/javascript">
// Note: Do not expose key like this in production setting!
// See https://sapling.ai/docs/sdk/JavaScript/quickstart/#fullstack-quickstart
Sapling.init({
  key: "<API_KEY>",
  mode: 'dev',
  autocomplete: true,
});

const contentEditable = document.getElementById('editable');
Sapling.observe(contentEditable);

// AI detection: overall score plus per-sentence highlights.
document.getElementById('ai-detect-btn').addEventListener('click', () => {
  Sapling.checkOnce(contentEditable, {aiDetect: true});
});
</script>