Netlify
Deploy your Swarmz project to Netlify with preview URLs and custom domains
The Netlify integration connects your workspace to a Netlify account, lets you link a Swarmz project to a Netlify site, and deploys on every push. Netlify auto-detects the build command and publish directory based on your framework, runs the build on its CDN, and gives you a unique URL per branch.
The deploy path mirrors Vercel: GitHub-driven by default — you push, Netlify builds, the site updates. You can also kick off a manual deploy from the Swarmz editor when you want to ship without committing.
Setup
Go to Settings → Integrations and click Netlify.
A popup opens with Netlify's authorization screen. Sign in to the Netlify account or team you want to use, then approve.
The popup closes. The Netlify card flips to Connected with your team or username displayed.
The OAuth flow runs through the integration-oauth edge function with provider: "netlify". The token exchange goes through https://api.netlify.com/oauth/token, the access token is encrypted with TOKEN_ENCRYPTION_KEY, and a row is inserted into workspace_connections with integration_id = "netlify".
Linking a project
Open the project and click Deploy in the editor toolbar.
Choose Netlify.
Either pick an existing Netlify site or click Create new to spin one up. Swarmz attaches the new site to your linked GitHub repo so deploys auto-trigger.
For new sites, Create new is the fast path — Swarmz creates the Netlify site, wires the build settings (build command, publish directory) based on your framework, attaches the GitHub repo, and triggers an initial deploy. The first deploy URL appears in the editor in about a minute.
How deploys trigger
| Trigger | What happens |
|---|---|
| Git push | When the linked GitHub repo receives a push, Netlify starts a build. Pushes to main deploy to production; every other branch gets a deploy preview URL. |
| Manual deploy from editor | Click Deploy → Deploy now. Swarmz calls the Netlify API to upload the project's current container state as a deploy, no commit required. |
The manual path is useful when you want a preview URL for something not yet committed — sharing a draft with a stakeholder, testing a build against a staging env, etc.
Build settings
Netlify needs to know your build command and publish directory. Swarmz fills these in from your framework:
| Framework | Build command | Publish dir |
|---|---|---|
| Next.js | next build | .next (handled by Netlify's Next runtime) |
| Vite | vite build | dist |
| Astro | astro build | dist |
| Remix | remix vite:build | build/client |
| SvelteKit | vite build | build |
You can override these from the Netlify card if your project is non-standard. Changes apply on the next deploy.
Environment variables
As with Vercel, env vars live in two places — Swarmz project settings (preview and runtime) and Netlify (build and production). Toggle Auto-sync env to Netlify on the Netlify card to push them on every deploy.
Mapping:
Swarmz development env → Netlify "Branch deploys" + "Local development"
Swarmz preview env → Netlify "Deploy previews"
Swarmz production env → Netlify "Production"Secret-marked variables stay encrypted on both sides.
Custom domains and SSL
Custom domains live with Netlify:
Open the linked Netlify site's dashboard.
Go to Site settings → Domain management → Add custom domain.
Update your DNS records to point at Netlify (CNAME or apex via Netlify DNS).
Netlify provisions Let's Encrypt SSL automatically once DNS is verified — usually within 5 minutes.
Reading deploy status
The editor toolbar shows the latest deploy's status (enqueued, building, ready, error) and lets you open the build logs inline. Failed deploys surface their error in the same UI, and you can ask the agent to investigate:
The Netlify deploy failed — pull the logs and fix it.The agent fetches the build log via the Netlify API, identifies the error, applies a fix, and triggers another deploy.
Branch deploys vs. deploy previews
Netlify runs two flavors of preview:
- Branch deploys — every branch you push to gets its own URL like
https://branch-name--site-name.netlify.app. Useful for long-lived feature branches. - Deploy previews — every PR opened against
maingets a temporary URL likehttps://deploy-preview-12--site-name.netlify.app. Useful for code review.
Both are enabled by default. Toggle them on the Netlify card or in the Netlify site settings.
Disconnecting
Settings → Integrations → Netlify → Disconnect revokes the OAuth token and removes the workspace_connections row. Existing Netlify sites keep running — only the link from Swarmz is severed.
To deploy somewhere else after disconnecting, see Vercel — same flow, different host.