1. Install with an install token
An install token (rnpm_…) lets npm install download the @reductoai/* packages. Make one on the Office SDK page in Reducto Studio.
Studio gives you two lines for .npmrc:
npm install fails with 403, your lockfile or package.json asks for a version that your token cannot install. To fix it, run npm install @reductoai/docx.
About tokens:
- Make one token for each machine or CI job. Give it a label that tells which one. There is no limit on the number of tokens.
- You see the token one time only. If you lose it, make a new one.
- All tokens of your organization install the same package. Lockfile hashes are the same on all machines.
- When you revoke a token, new installs with it fail. Copies that you installed before continue to work.
- Self-serve tokens install
@reductoai/docx,@reductoai/docx-editor,@reductoai/viewerand@reductoai/portable-fonts. The PowerPoint and Excel packages are in private preview with alpha customers. Contact us to get access.
2. On a server: set REDUCTO_API_KEY
In Node, the package reads REDUCTO_API_KEY from the environment. You do not change your code:
REDUCTO_LICENSE. Copy the JSON from node_modules/@reductoai/docx/reducto-license.js of an install made with your install token:
REDUCTO_LICENSE. Either way, nothing opens until Reducto accepts it.
3. In a browser: add the license proxy
Do not put your Reducto API key in a page, because all users can read it. A browser editor sends its license traffic to your backend, and your backend adds the key. Without a proxy, a browser editor does not run. On your backend, addlicenseProxy() behind your own login check. It forwards only license checks and usage reports to Reducto and adds your API key. It answers 404 to all other requests. A Next.js route:
licenseProxy() returns a (request: Request) => Promise<Response> function. It works without changes in Next.js route handlers, Hono, Cloudflare Workers, Deno and Bun. Options:
Express does not give you a
Request, so wrap the proxy:
proxyUrl:
mountDocxEditor, call useProxy("/reducto") from @reductoai/docx-editor one time at startup.
Firewalls and networks with no internet access
The package connects only tonpm.reducto.ai, over HTTPS on port 443. If your network blocks outbound traffic, allow this host:
Allow the hostname, not IP addresses.
npm.reducto.ai is served through Cloudflare, and its IP addresses can change without notice. If your firewall accepts only IP ranges, allow Cloudflare’s published ranges.
Make sure that the setup works
- Open a document. The first open waits for a good license check. If the document does not open and you see “Your package isn’t configured properly.”, see Troubleshooting.
- Look at the console. If there are no warnings from Reducto, the setup is correct. Troubleshooting lists all warnings.