- The app calls the Azure Chat Completions API and replaces the selected text with the AIβs rewritten version.
All configuration is handled via Vite environment variables. Create a .env.local file in the project root:
VITE_AZURE_OPENAI_ENDPOINT=https://YOUR-RESOURCE-NAME.openai.azure.com
VITE_AZURE_OPENAI_API_KEY=YOUR-SECRET-KEY
VITE_AZURE_OPENAI_DEPLOYMENT=YOUR-DEPLOYMENT-NAME
VITE_AZURE_OPENAI_API_VERSION=2024-08-01-preview- VITE_AZURE_OPENAI_ENDPOINT β Your Azure OpenAI resource endpoint.
- VITE_AZURE_OPENAI_API_KEY β Your Azure API key.
- VITE_AZURE_OPENAI_DEPLOYMENT β The deployment name you created (e.g.,
gpt-4o-mini). - VITE_AZURE_OPENAI_API_VERSION β API version (defaults to
2024-08-01-preview).
β οΈ Security note: Because this calls Azure directly from the browser, the API key is visible in DevTools. For production, proxy via a backend.
git clone https://github.com/jzakotnik/tiptap-azure-ai.git
cd tiptap-azure-ai
npm installCreate .env.local and add your Azure credentials (see Configuration).
npm run devVisit: http://localhost:5173
npm run build
npm run preview- π¨ Gradient + glassmorphism UI
- π Rich-text editing with Tiptap
- π Selection preview
- π¬ Chat panel for instructions
- π€ Live Azure AI rewriting
- π± Responsive design (mobile/desktop)
MIT β feel free to adapt and extend!