Dear Huff, Steve
Thank you for reaching out to the Q&A Forum.
I completely understand your concern about ensuring reliability when the CDN is unavailable, especially after the recent outage. It’s a valid point and something many developers worry about when planning fallback strategies for Office.js.
Based on my research, Microsoft states in @microsoft/office-js - npm “For the NPM package sourced through this repository, only the latest version of the package is supported. No support and no patches will be provided for previous versions of the package. The frequency of the updates to this repository and related NPM package to match the CDN version is not guaranteed.” This implies that the update cadence is not guaranteed. As a moderator, I cannot confirm any future update cadence or guarantee synchronization between NPM and CDN, and I apologize for not being able to provide a definitive timeline.
For maintaining a local fallback copy, I found some community discussions suggesting that developers download the necessary files directly from the CDN and bundle them with their add-ins. For reference, please take a look at these threads:
- Why doesn't office.js work when locally referenced? - Stack Overflow
- office.js, which files should be included and distributed from package - Stack Overflow
However, there isn’t a single “full package” download like a ZIP because Office.js functions as a loader script that dynamically pulls in additional host-specific files (such as for Excel, Word, or Outlook) based on the runtime context. To implement this, you can download the main script directly from the CDN at https://appsforoffice.microsoft.com/lib/1/hosted/office.js, and for preview APIs, use https://appsforoffice.microsoft.com/lib/beta/hosted/office.js.
Then, bundle these files with your add-in for offline scenarios.
For more details, please refer to the official documentation: Referencing the Office JavaScript API library - Office Add-ins | Microsoft Learn
As alternatives, you can use the OfficeDev/office-js GitHub repository for reference and issue tracking, but note that it’s not intended as a distribution source. There is also a Microsoft.Office.js package available on NuGet, but it is not officially supported for production environments.
The recommended best practice is to always use the CDN for production. For internal or secure environments, download from the CDN and host locally, updating manually when new versions are released. To keep your local copy current, you’ll need to repeat this process periodically, such as monthly or after known updates, by checking for any new or changed files.
Thank you again for raising this important question.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.