SynapseEdge Defense

Synapse Client Integration

Install the CLI. Point it at a running Synapse. Inspect rules, evaluate requests, manage blocks — from the terminal or a TypeScript program. Four steps from npm install to first managed block.

4
Onboarding Steps
20+
CLI Commands
TS
Typed Client
Node 18+
Runtime
Four-Step Onboarding
01
Install
Grab the CLI + typed TypeScript client from npm.
$ npm install -g \
  @atlascrew/synapse-client
02
Point
Set the server URL. Optional JSON output, debug, and timeout.
$ export SYNAPSE_URL=\
  https://synapse.example.com
03
Verify
First command: health check. Expect 200 & uptime.
$ synapse health
{"ok":true}
04
Operate
Manage rules, inspect blocks, evaluate live traffic shapes.
$ synapse status --json
$ synapse evaluate GET /api/
Command Surface — What You Can Do
Health & Status
synapse health
synapse status
synapse metrics # prom
Entity Management
synapse entities
synapse blocks
synapse release <ip>
synapse release-all
Rule Management
synapse rules
synapse rule-add <json> <ttl>
synapse rule-remove <id>
synapse reload
Rule Evaluation
synapse evaluate GET \
  "/api/users?id=1"
# dry-run against loaded rules
Configuration
synapse config
synapse config-set \
  risk_decay=15
Global Flags
--json    # JSON output
--debug   # verbose
--timeout # ms
--url     # override
Environment Configuration
ENV VARFLAGDESCRIPTION
SYNAPSE_URL
-u, --url
Synapse server base URL. Required. No default — fails fast if missing.
SYNAPSE_JSON
--json
Emit structured JSON instead of human-readable tables. Ideal for CI & scripts.
SYNAPSE_DEBUG
-d, --debug
Verbose HTTP & request-body logging. Shows every call the client makes.
SYNAPSE_TIMEOUT
-t, --timeout
Per-request timeout in milliseconds. Default 30000. Tune for slow networks.
Programmatic — TypeScript Client
Same capabilities, typed. Import directly from @atlascrew/synapse-api.
// install:  npm install @atlascrew/synapse-api
import { SynapseClient } from '@atlascrew/synapse-api';

const client = new SynapseClient({
  baseUrl: process.env.SYNAPSE_URL!,
  timeout: 30_000,
});

// health & status
await client.health();
const status = await client.getStatus();
console.log(status.totalRequests, status.blockedRequests);

// manage rules at runtime
await client.addRule({ id: 9001, matches: [/* ... */] }, { ttlSec: 3600 });

// dry-run a request against the loaded rule set
const verdict = await client.evaluate('GET', '/api/users?id=1');
if (verdict.blocked) console.log('would block:', verdict.matched_rule);