Browser SDK
When the export is triggered by a user in a browser, you don’t call this API directly — you ship the open-source SDK and give it a publishable key. The SDK opens the session from the browser, polls it, and renders progress; your secret API key stays on your server, where it belongs.
The SDK is MIT-licensed and works without an Eazip account for local,
in-browser ZIPs. A key is only needed for the cloud strategy, which moves
the job server-side when the tab can’t hold it.
The two keys
Section titled “The two keys”| Key | Where it lives | What it’s for |
|---|---|---|
zk_… (secret) | Your server only | Calling this HTTP API — Quick Start |
pk_ez_… (publishable) | Shipped in your JS bundle | Letting a browser open an export session via the SDK |
A publishable key is safe to expose — like a Stripe publishable key. What limits it is the Public App behind it: the origins it may be used from, the hosts it may fetch files from, and the per-session ceilings.
1. Install
Section titled “1. Install”npm install @eazip/react # or @eazip/core for framework-agnostic JavaScript2. Create a Public App
Section titled “2. Create a Public App”- Open Public Apps in your dashboard
- Click Create app and give it a name your team will recognize
- Under Websites that can use this key, add every exact browser origin
your app runs on, including
http://localhost:3000for local development - Under Where the files come from, add the CDN, bucket, or asset hosts Eazip should download from — this is usually a different list from your websites
- Leave Advanced settings on the recommended defaults unless you need to restrict delivery mode, file count, retention, or total size
- Click Create app & get key. The
pk_ez_…key stays readable on the app card
Both lists are edited inline: Add another… adds a row, while the button at the bottom creates or saves the app once.
The edit page uses the same two lists. Changes affect new exports immediately, and you can pause an app without deleting it or rotating its key.
3. Ship it
Section titled “3. Ship it”'use client';
import { EazipTray, useEazip } from '@eazip/react';
function Exporter({ urls }) { const zip = useEazip();
return ( <> <button onClick={() => zip.download({ strategy: 'cloud', publicKey: process.env.NEXT_PUBLIC_EAZIP_KEY, files: urls, }) } > Download as ZIP </button> <EazipTray /> </> );}<EazipTray /> narrates progress, cancellation, partial results, failures, and
the finished download. Drop strategy and publicKey and the same call zips
locally in the browser instead — no account involved.
Creating the session from your backend instead
Section titled “Creating the session from your backend instead”If the frontend shouldn’t even know the file URLs — signed S3/R2 links, for
example — your backend creates the session and hands the browser only
{ sessionId, clientSecret }. The SDK attaches to it with a createSession
callback and never sees a key. See
Backend-created sessions in the
SDK documentation.
Full SDK documentation
Section titled “Full SDK documentation”The SDK has its own documentation site, covering the hook, the tray, resume after reload, multi-zip splitting, and the error taxonomy:
- SDK documentation — start here
- React quickstart
- Get a public key — the same dashboard steps as above, with troubleshooting
- GitHub · npm