{"id":13769572,"url":"https://github.com/etozhealkhipce/editorjs-aitext","last_synced_at":"2025-09-13T17:16:42.292Z","repository":{"id":206468113,"uuid":"716952174","full_name":"etozhealkhipce/editorjs-aitext","owner":"etozhealkhipce","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-31T20:02:41.000Z","size":78,"stargazers_count":40,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-01T23:49:54.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etozhealkhipce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-10T08:16:25.000Z","updated_at":"2025-08-22T11:44:36.000Z","dependencies_parsed_at":"2023-11-10T13:20:09.174Z","dependency_job_id":"3f47349c-ff45-41e4-b1d5-a5c163e0e595","html_url":"https://github.com/etozhealkhipce/editorjs-aitext","commit_stats":null,"previous_names":["etozhealkhipce/editorjs-aitext"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/etozhealkhipce/editorjs-aitext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etozhealkhipce%2Feditorjs-aitext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etozhealkhipce%2Feditorjs-aitext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etozhealkhipce%2Feditorjs-aitext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etozhealkhipce%2Feditorjs-aitext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etozhealkhipce","download_url":"https://codeload.github.com/etozhealkhipce/editorjs-aitext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etozhealkhipce%2Feditorjs-aitext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274997547,"owners_count":25387934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:00:28.703Z","updated_at":"2025-09-13T17:16:42.261Z","avatar_url":"https://github.com/etozhealkhipce.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":["Block Tools"],"readme":"[![](https://flat.badgen.net/npm/v/@alkhipce/editorjs-aitext?icon=npm)](https://www.npmjs.com/package/@alkhipce/editorjs-aitext)\n[![](https://flat.badgen.net/github/stars/etozhealkhipce/editorjs-aitext)](https://github.com/etozhealkhipce/editorjs-aitext)\n\n# AI Text Tool for Editor.js\n\nAI suggestion text Tool for the [Editor.js](https://ifmo.su/editor) based on the default [Paragraph Tool](https://github.com/editor-js/paragraph/tree/master) and [OpenAI Node.js library](https://github.com/openai/openai-node).\n\nWhile writing with this tool you will get some OpenAI suggestion after 2 seconds delay. You can accept or decline it.\n\n![image](https://github.com/etozhealkhipce/editorjs-aitext/assets/38625168/ebedb41d-085c-4046-af02-d498babf6395)\n\n## Bindings:\n\nAccept suggestion: 'Right or Left ALT buttons'\u003cbr\u003e\nDecline suggestion: 'Backspace or ESC buttons'\n\n## Installation\n\nGet the package\n\n```shell\nnpm i @alkhipce/editorjs-aitext\n```\n\nInclude module at your application\n\n```javascript\nimport AIText from '@alkhipce/editorjs-aitext'\n```\n\n## Usage for ver \u003e= 1.2.0\n\n## If your project uses versions lower than 1.2.0, please read the old tutorial below\n\nAdd a new Tool to the `tools` property of the Editor.js initial config.\n\n```javascript\nvar editor = EditorJS({\n  ...\n\n  tools: {\n    ...\n      aiText: {\n        // if you do not use TypeScript you need to remove \"as unknown as ToolConstructable\" construction\n        // type ToolConstructable imported from @editorjs/editorjs package\n        class: AIText as unknown as ToolConstructable,\n        config: {\n          // here you need to provide your own suggestion provider (e.g., request to your backend)\n          // this callback function must accept a string and return a Promise\u003cstring\u003e\n          callback: (text: string) =\u003e {\n            return new Promise(resolve =\u003e {\n              setTimeout(() =\u003e {\n                resolve('AI: ' + text)\n              }, 1000)\n            })\n          },\n        }\n      },\n  }\n\n  ...\n});\n```\n\n## Usage for ver \u003c 1.2.0\n\nAdd a new Tool to the `tools` property of the Editor.js initial config.\n\n```javascript\nvar editor = EditorJS({\n  ...\n\n  tools: {\n    ...\n      aiText: {\n        // if you do not use TypeScript you need to remove \"as unknown as ToolConstructable\" construction\n        class: AIText as unknown as ToolConstructable,\n        config: {\n          openaiKey: 'YOUR_OPEN_AI_KEY'\n        }\n      },\n  }\n\n  ...\n});\n```\n\n## Config Params\n\nThe AI Text Tool supports these configuration parameters:\n\n| Field                  | Type       | Description                                                                                  |\n| ---------------------- | ---------- | -------------------------------------------------------------------------------------------- |\n| placeholder            | `string`   | The placeholder. Will be shown only in the first paragraph when the whole editor is empty.   |\n| preserveBlank          | `boolean`  | (default: `false`) Whether or not to keep blank paragraphs when saving editor data           |\n| (DEPRECATED) openaiKey | `string`   | Required parameter                                                                           |\n| callback               | `function` | Required parameter. This callback function has to accept a string and return Promise\u003cstring\u003e |\n\n## Output data\n\n| Field | Type     | Description      |\n| ----- | -------- | ---------------- |\n| text  | `string` | paragraph's text |\n\n```json\n{\n  \"type\": \"aiText\",\n  \"data\": {\n    \"text\": \"Check out our projects on a \u003ca href=\\\"https://github.com/codex-team\\\"\u003eGitHub page\u003c/a\u003e.\"\n  }\n}\n```\n\n## Roadmap\n\n1. Add types (done)\n2. Add styles file\n3. Improve loader icon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetozhealkhipce%2Feditorjs-aitext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetozhealkhipce%2Feditorjs-aitext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetozhealkhipce%2Feditorjs-aitext/lists"}