ozvault home

INTEGRATIONS

Integrate private file storage with Next.js

Keep credentials on the server, use a small authenticated bridge, and send encrypted file bodies directly to the storage API.

Separate the two origins

#

Deploy Next.js to Vercel and run the persistent API on the Windows storage machine. Configure SITE_URL for canonical metadata and the public API origin for direct transfers. Vercel does not access D:\OzVault or persist uploaded files.

Keep private credentials server-side

#

For trusted server components, instantiate the SDK with an API key stored in a non-public environment variable. Never prefix this credential with NEXT_PUBLIC. An application serving multiple users must authorize which operations it performs on their behalf.

TypeScript
// Server-only module
import 'server-only';
import { OzVault } from '@ozvault/sdk';
export const vault = new OzVault({
  baseUrl: process.env.OZVAULT_API_ORIGIN!,
  apiKey: process.env.OZVAULT_API_KEY
});

Send large bytes directly

#

Use small authenticated requests to create upload reservations and issue bounded upload capabilities. Encrypt in the trusted client, then send chunks to the API origin. Do not stream uploads through Vercel Functions. Keep CORS restricted to configured frontend origins.

Clear documentation is part of the product.