diff --git a/docs.json b/docs.json index bd39aed..24b0ae6 100644 --- a/docs.json +++ b/docs.json @@ -57,7 +57,8 @@ "docs/learning-how-tos/cookbook/google-sheets", "docs/learning-how-tos/cookbook/automating-indie-game-localization-with-the-deepl-api-and-godot", "docs/learning-how-tos/cookbook/java-document-translator", - "docs/learning-how-tos/cookbook/usage-analytics-dashboard" + "docs/learning-how-tos/cookbook/usage-analytics-dashboard", + "docs/learning-how-tos/cookbook/nodejs-proxy" ] }, { diff --git a/docs/best-practices/cors-requests.mdx b/docs/best-practices/cors-requests.mdx index e83fe34..17af719 100644 --- a/docs/best-practices/cors-requests.mdx +++ b/docs/best-practices/cors-requests.mdx @@ -11,4 +11,4 @@ If you realize your API authentication key has been compromised, log in to your To safely use the DeepL API on your website or application, you can route your requests through your own backend servers. This keeps your credentials hidden and allows you to specify CORS policies and rate limits as required by your use case. -DeepL's official open-source [client libraries](/docs/getting-started/client-libraries) can help you create these backend implementations. +DeepL's official open-source [client libraries](/docs/getting-started/client-libraries) can help you create these backend implementations. For prototyping and frontend testing, you can use the [DeepL API Node.js Proxy](https://github.com/DeepLcom/deepl-api-nodejs-proxy/), a lightweight ready-to-use proxy server that handles CORS and keeps your API key secure. diff --git a/docs/learning-how-tos/cookbook.mdx b/docs/learning-how-tos/cookbook.mdx index a840543..1baf0b6 100644 --- a/docs/learning-how-tos/cookbook.mdx +++ b/docs/learning-how-tos/cookbook.mdx @@ -34,4 +34,9 @@ public: true Updated on 2025-12-17 + + A ready-to-use proxy server for secure browser-based API calls + + Updated on 2024-10-30 + \ No newline at end of file diff --git a/docs/learning-how-tos/cookbook/nodejs-proxy.mdx b/docs/learning-how-tos/cookbook/nodejs-proxy.mdx new file mode 100644 index 0000000..1f0d253 --- /dev/null +++ b/docs/learning-how-tos/cookbook/nodejs-proxy.mdx @@ -0,0 +1,36 @@ +--- +title: "Node.js Proxy Server" +description: "A lightweight local proxy for the DeepL API that enables browser-based applications to bypass CORS restrictions." +public: true +--- + + + DeepL API Node.js Proxy on GitHub + + + +## Overview + +This lightweight proxy server lets you call the DeepL API directly from browser-based applications. In simpler terms, it lets you make DeepL API calls from your client-side JavaScript without running into browser security restrictions. + +Since the DeepL API doesn't allow direct browser requests (see [CORS requests documentation](/docs/best-practices/cors-requests)), this proxy handles CORS headers and keeps your API key secure. Perfect for hackathons, demos, and quick prototypes where you need to get up and running fast. + +Built with Node.js and Express with minimal dependencies. Supports all DeepL API endpoints including text translation, document translation, and glossaries. Includes an interactive web demo for testing translations right in your browser. + + +This proxy is intended for prototyping and frontend testing. For production environments, consider implementing your own backend service with additional security measures and rate limiting. + + +## Quick Start + +The proxy includes an interactive setup wizard to get you started quickly. Clone the repo, run the setup, and start sending requests from your browser. Check out the [GitHub repository](https://github.com/DeepLcom/deepl-api-nodejs-proxy) for full setup instructions and Docker support. + +## Screenshots + + + Node.js proxy server running and ready to accept requests + + + + Interactive web demo interface for testing translations +