Node.js SDK
Deploy and manage Synq from JavaScript or TypeScript.
The synq package gives your application access to projects, deployments, domains, backups, and
the other platform operations. Native SDK calls and HTTP controllers use the same shared core.
Choose a mode
| Mode | Use when | Start here |
|---|---|---|
| Remote client | Synq already runs on a server. | Connect to an API |
| Native SDK | Your Node application owns storage, providers, and the installation lifecycle. | Embed Synq |
Both modes expose the same named operation groups. A configured provider and the caller's permissions determine which operations can run.
Install
Synq isn't published to npm. Get and install the SDK package before using these imports.
A deployment in code
This function accepts either a remote client or a native user scope:
import type { SynqClient, ScopedShip } from "synq";
export async function deploySite(ship: SynqClient | ScopedShip) {
const submitted = await ship.deploy({
name: "my-site",
source: { type: "files", files: { "index.html": "<h1>Hello from Synq</h1>" } },
});
const outcome = await ship.deployment(submitted.deployment_id).wait({ timeoutMs: 120_000 });
if (!outcome.success) throw new Error(outcome.message ?? outcome.status);
return ship.projects.get(submitted.project_id);
}Next steps
Deployment workflows
Deploy files, directories, or Git sources; follow logs and handle decisions.
Users and organizations
Select a tenant and connect your application's verified identities.
Runnable example
Deploy, redeploy, reopen state, and clean up using the installed package.
Method reference
Find every current operation, organized by resource.