How I put ChatGPT into a WYSIWYG editor

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - JavaScript Form Builder with No-Code UI & Built-In JSON Schema Editor
Keep full control over the data you collect and tailor the form builder’s entire look and feel to your users’ needs. SurveyJS works with React, Angular, Vue 3, and is compatible with any backend or auth system. Learn more.
surveyjs.io
featured
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
  1. vrite

    Open-source developer content platform

    The process basically came down to figuring out the position and size of the block node, given a selection of an entire top-level node or just its child node (source code):

  2. SurveyJS

    JavaScript Form Builder with No-Code UI & Built-In JSON Schema Editor. Keep full control over the data you collect and tailor the form builder’s entire look and feel to your users’ needs. SurveyJS works with React, Angular, Vue 3, and is compatible with any backend or auth system. Learn more.

    SurveyJS logo
  3. tiptap

    The headless rich text editor framework for web artisans.

    The buttons had to be absolutely positioned, which required both a custom TipTap extension and tapping deeper into the underlying ProseMirror (both libraries powering the Vrite editor).

  4. openai-node

    Official JavaScript / TypeScript library for the OpenAI API

    Unfortunately, the official Node.js SDK doesn’t support streaming and requires you to use workarounds to get it working, resulting in much more code required, just to connect with the API (source code):

  5. fetch-event-source

    A better API for making Event Source requests, with all the features of fetch()

    The EventSource Web API for handling SSEs (built into most modern browsers) unfortunately supports only GET requests, which was quite limiting when a POST request with larger body JSON data was required. As an alternative, you can use the Fetch API or a ready library like Microsoft’s Fetch Event Source.

  6. ProseMirror

    The ProseMirror WYSIWYM editor

    The buttons had to be absolutely positioned, which required both a custom TipTap extension and tapping deeper into the underlying ProseMirror (both libraries powering the Vrite editor).

  7. marked

    A markdown parser and compiler. Built for speed.

    Again, with streaming enabled, you’ll now receive new tokens as soon as they’re available. Given that OpenAI’s API uses Markdown in its response format, a full message will need to be put together from the incoming tokens and parsed to HTML, as accepted by the replaceContent function. For this purpose, I’ve used the Marked.js parser.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Melhores editores HTML para usar em aplicações JavaScript em 2025

    1 project | dev.to | 12 Dec 2024
  • Word-like HTML inline edit with design mode

    1 project | news.ycombinator.com | 13 Oct 2024
  • Testing ViewComponent w/ Capybara

    1 project | dev.to | 20 Aug 2024
  • How to use Cloudflare R2 with Ruby on Rails Active Storage

    2 projects | dev.to | 26 Jun 2023
  • Formatting tags in reviews

    1 project | /r/TheStoryGraph | 22 Jun 2023