---
id: "service-discovery"
type: "concept"
title: "Service discovery via package.json"
summary: "Servix finds a service entry through the servix.entry field in package.json, so any compatible npm package is installable by name."
problem: "Without a discovery contract, installing a service would require knowing its internal file layout."
why: "A single well-known field makes every compatible package self-describing — servix install works on the package name alone."
mentalModel: "package.json declares where the service definition lives; the CLI does the rest."
audiences: ["developers"]
related: ["wrap-once-run-managed"]
next: ["install-and-run"]
---
# Service discovery via package.json

Declare the Servix entry in `package.json`:

```json
{
  "name": "@x12i/my-service",
  "servix": {
    "entry": "dist/servix.service.js"
  }
}
```

Then `servix install @x12i/my-service` resolves the entry automatically. During development, `servix install ./dist/servix.service.js` bypasses discovery with a direct path.