Please go to our [discussion forum](https://github.com/spencerwooo/onedrive-vercel-index/discussions) for general questions and FAQs, **issues are for bug reports and bug reports only.** Feature requests may or may not be ignored, as [I (@spencerwooo)](https://spencerwoo.com) am the only one maintaining the project, so **I only prioritise features that I use.**
> Starting now, you don't have to manually acquire your tokens, and you don't need to register a client at Microsoft anymore ([PR #210](https://github.com/spencerwooo/onedrive-vercel-index/pull/210) and [Discussion #215](https://github.com/spencerwooo/onedrive-vercel-index/discussions/215)).
- Only change [`config/api.json`](config/api.json) if you must (if you are not a OneDrive international user).
- SharePoint users need to define their own API endpoints.
- Import your forked `onedrive-vercel-index` GitHub project to Vercel. Vercel will automatically build the Next.js project, so please wait for deployment to finish.
- Create a Redis database, and set the URL of the Redis instance to environment variable `REDIS_URL` inside the Vercel project.
- You can use Upstash for this, completely free, full integration with Vercel, documentation here: [Vercel Integration
- Finally, trigger a redeployment on Vercel to use the new environment variable, navigate to the newly deployed page, and perform authorisation as guided by `onedrive-vercel-index`.
### Migrating from an old project
- You need to first create a Redis instance, and define the URL of the instance in the environment variable `REDIS_URL` in Vercel.
- Likewise, you can still use Upstash for this, same as above.
- You need to revert some fields of your customised `config/api.json` back, where specifically the `clientId` and `obfuscatedClientSecret` should exactly match:
- You also need to define `userPrincipalName` inside `config/site.json`, which is used to verify your identity when doing OAuth. It is usually your Microsoft email address.
- You can safely delete old environment variables such as your own `CLIENT_SECRET`, `ACCESS_TOKEN`, and `REFRESH_TOKEN`.
Deployment issues *please, please, please* post to the [discussion forum](https://github.com/spencerwooo/onedrive-vercel-index/discussions) with tags `FAQ`.
A few things to keep in mind for `config/site.json`:
-`icon` - is the website icon to the left of the title inside the navigation bar. It should be placed under `/public/` and referenced here by its relative path.
-`maxItems` - represents the maximum number of items that one directory lists, pagination supported. This is limited up to 200 items by the upstream OneDrive API.
-`email` - is optional, and can be removed should you wish. However, I suggest adding some form of contact for your website.
-`links` - is an array of `{ "name": "xxx", "link": "xxx" }`. In the latest update, all brand icons inside font awesome is supported and the icon to render is based on the `name` you provide. See the demo screen recording below. _(The additional links in the demo video are generated automatically by GitHub Copilot and may not be my personal account.)_
We use JSZip to download all files in-browser and compress them into file blobs, which are then downloaded to your device as a `zip` file. This is extremely useful if a series of small files are to be downloaded, but it could be time consuming if used for bulk-downloading a few large files.
Folders are traversed and recursively fetched into the compressed zip. Multiple files or folders can be selected and downloaded side-by-side.
Yes, it can be used as an image (or any kind of file) online storage, where the raw file link is exported and can be embedded into your blog or other websites. Images, videos, songs, PDFs..., you name it.
In order to speed up (I doubt it would?) download speed when files are directly served on OneDrive servers, we can leverage a proxied download which relays the file download stream through Vercel Serverless first, then back to our own device.
You can download a file via this method by either clicking on the `Proxy download` button beside the normal `Download` button in file preview pages ...
> An `&inline=true` parameter is also accepted here, where the response header `content-disposition` of the direct file stream from OneDrive is replaced from `attachment, filename*=...` to `inline, filename*=...`. This only applies to PDF files with a header `content-type` of `application/pdf`, so that the PDF returned can be viewed inside the browser, instead of being force downloaded.
*Feature parity with original project: [Proxied / raw file download](https://github.com/spencerwooo/onedrive-cf-index#%EF%B8%8F-proxied--raw-file-download).*