Create a node package

Start a node package from the template, then build and test it.

A node package adds nodes and credential types to Zerodot. Use the template to make your own package.

A community author publishes the package under their own name. Use zerodot-<name> or @scope/zerodot-<name>. Zerodot does not accept other names from a registry. Only the Zerodot team publishes @zerodot/* packages.

Make the package

The template is at github.com/zerodot-io/create. One repository holds one registry. Each folder in packages/* is one npm package. A package can have many nodes.

  1. Click Use this template on GitHub, or copy the folder.
  2. In the root package.json, set zerodot.registry.name and zerodot.registry.homepage. Admins see the name.
  3. Rename packages/example. In its package.json, change name, description, zerodot.label, and zerodot.summary.
  4. Change the node types. Start each type with your own prefix, for example acme.slack.send.
  5. Set the icon. See Icons.
  6. Run the checks:
pnpm install
pnpm test
pnpm run check-types
pnpm run lint

To add a package, copy packages/example to packages/<name>. Put nodes that people install together in one package. Make a new package for a different app.

Package name

The name without the scope must start with zerodot-. Examples: zerodot-slack, @acme/zerodot-slack. A registry cannot list @zerodot/* names.

Node type prefix

A node type must be unique. Use your own prefix, for example acme.slack.send. A package cannot replace a built-in node.

Files

The example package has these files:

File Content
src/index.ts Exports nodes and credentialTypes.
src/text-case.ts A node with no credential.
src/api-request.ts A node with a credential. It calls an API.
src/credential.ts A credential type with a token and test().
src/nodes.test.ts Tests for the nodes.

package.json has this field:

{ "zerodot": { "sdk": "^1.2" } }

It is the range of SDK versions that the package works with. Zerodot checks it before it runs package code. See Node SDK reference.

Icons

Each node and credential type has two icon fields:

  • iconUrl: your logo. Put it in icon.svg. The file src/icon.ts reads it with fileIcon. .png and .webp also work.
  • icon: the name of a Hugeicons icon, for example Mail01Icon.

Zerodot shows icon only when the node has no iconUrl. A name that Zerodot does not know shows a circle. If icon.svg is missing, the package does not load.

Community packages can use both fields. To use only icon, delete icon.svg, src/icon.ts, and each iconUrl line. Also remove icon.svg from files in package.json.

Enum labels and hints

Each enum in a node config needs labels and hints in .meta().

case: z.enum(["upper", "lower", "title"]).default("upper").meta({
  title: "Case",
  labels: { upper: "UPPER CASE", lower: "lower case", title: "Title Case" },
  hints: {
    upper: "Make all letters capital letters",
    lower: "Make all letters small letters",
    title: "Make the first letter of each word a capital letter",
  },
}),

Tests

The template tests use node:test and tsx. Run pnpm test. The tests check these items:

  • Each node and credential type has an icon.
  • Each default config fits its schema.
  • Each node runs with a sample input.

Build

The build makes one CommonJS file: dist/index.cjs. Zerodot can then load a new version without a restart.

  • @zerodot/node-sdk and zod are peer dependencies. Zerodot gives them. Do not bundle them.
  • Put other libraries in dependencies.
  • Install scripts do not run. A package with a native build step does not work.

Next steps

  1. Publish the package and write registry.json. See Publish a node package.
  2. Ask the Zerodot team to review a version. A reviewed version shows "Verified". See Get verified. Verified does not make it an official @zerodot/* package.
  3. Read the limits in Community package limits.

Change this page on GitHub