{"_id":"brandnet-connect","_rev":"3-6da56a60d958e76953b6e6f53cd735ba","name":"brandnet-connect","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.0-stage":{"name":"brandnet-connect","version":"0.0.0-stage","_id":"brandnet-connect@0.0.0-stage","stub":true,"maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"dist":{"shasum":"f44f28efed40ec3184eb38bfc5fe644cf9ee15c8","tarball":"https://registry.npmjs.org/brandnet-connect/-/brandnet-connect-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-U+PyRxK6UgyeMdUSEEisNPCy5bcz16k6gVM96vFs71oqqxqq7Smivk+9Cmf6rNe73+MyegyLHtKCeD+gu48NfA==","signatures":[{"sig":"MEUCIAIfHSNAHs72aWQANT1Z8WE3IJcyjvbKtMdfwXvYO1JeAiEAxVp0HC0w3RRWkCVKVEeMj2vRUaxXg/m1nqHZXFGBAxc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":338},"_npmUser":{"name":"zmaticoo","email":"venstate25@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"1.0.0":{"name":"brandnet-connect","version":"1.0.0","keywords":["trading","brands","crm","connectivity","api","dsp"],"author":{"name":"Zmat DSP Engineering","email":"venstate25@gmail.com"},"license":"MIT","_id":"brandnet-connect@1.0.0","maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"homepage":"https://github.com/zmatdspcrm/trading-connector#readme","bugs":{"url":"https://github.com/zmatdspcrm/trading-connector/issues"},"dist":{"shasum":"6f6cd14e8d0346fdb7969b06970a5f227805b5e4","tarball":"https://registry.npmjs.org/brandnet-connect/-/brandnet-connect-1.0.0.tgz","fileCount":3,"integrity":"sha512-Ec4A5zo7TaTmJYXWloI8cVHPjtzUb5USCNVh/gqinkB+/BSE1pUdeyo56bQfrAjE2izLgEntz+hChqiCMwH3Pw==","signatures":[{"sig":"MEQCIBIGlB/hHIHQ9UHnmMwfuEka7kW4SIXtYu2J3iZm7ruFAiB4jefu7i5N1H0VgXaRcvbpEqVh7XNHEjujcOxa75FRgA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFZL42kZ8aN2evjwaYumOrB17TRYzwmMHG1TzPWINjIQAiBkWDp7gTTWQi2yxt/89wtMk7KTG69cBgsN5e2pwiRRQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17702},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js"},"_npmUser":{"name":"zmaticoo","email":"venstate25@gmail.com"},"repository":{"url":"git+https://github.com/zmatdspcrm/trading-connector.git","type":"git","directory":"packages/brandnet-connect"},"_npmVersion":"11.4.2","description":"Zmat DSP trading connector — link brand-network trading sessions, accounts, and instruments to a connected CRM desk.","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"tradingConnector":{"components":{"brandnet-entitlement":{"dist":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz","version":"1.0.0","integrity":"sha512-YH/MushKDmt3hhptbO0RX7Nrli/1WF2KqocXLW48GpLB8Br/cs4rdN+aThB52pC/zVmD/IPg8CmO6mDWOwjbPA=="}}},"optionalDependencies":{"brandnet-entitlement":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz"},"_npmOperationalInternal":{"tmp":"tmp/brandnet-connect_1.0.0_1795026985748_0.3530183245088804","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"_id":"brandnet-connect@1.0.1","bugs":{"url":"https://github.com/zmatdspcrm/trading-connector/issues"},"dist":{"shasum":"a167e0c0d7c9e7da20ebb8d9da556a861723518e","tarball":"https://registry.npmjs.org/brandnet-connect/-/brandnet-connect-1.0.1.tgz","fileCount":3,"integrity":"sha512-HD8Tg2nCKgjHy/dGHDMYmlhDNGge1+2/Abc/NhmtqrTbavObxDpyKJUfZ0U0TsfFP3UlJlh6RRkGdruMWAxt3A==","signatures":[{"sig":"MEQCIBVKvowOSooTppMcSsPwyNWARQ2KwbyAjFjsNyLcqcNtAiBb1KkrwxgjV+XwyzhCUZv6IbeiDZHKpWVDHi+ptShSGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwd53DndhFT3Y1bRldQ8xTHzY4o8CTW+ROuURwz6OpNAIgBFKmv0i1/qUoZLrwRTfNn4TtdjnItGyUhvXsUUM+2mU="}],"unpackedSize":17716},"main":"index.js","name":"brandnet-connect","type":"module","author":{"name":"Zmat DSP Engineering","email":"venstate25@gmail.com"},"engines":{"node":">=18"},"exports":{".":"./index.js"},"license":"MIT","version":"1.0.1","_npmUser":{"name":"zmaticoo","email":"venstate25@gmail.com"},"homepage":"https://github.com/zmatdspcrm/trading-connector#readme","keywords":["trading","brands","crm","connectivity","api","dsp"],"repository":{"url":"git+https://github.com/zmatdspcrm/trading-connector.git","type":"git","directory":"packages/brandnet-connect"},"_npmVersion":"11.4.2","description":"Zmat DSP trading connector — link brand-network trading sessions, accounts, and instruments to a connected CRM desk.","directories":{},"maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"_nodeVersion":"22.21.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"tradingConnector":{"components":{"brandnet-entitlement":{"dist":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz","version":"1.0.0","integrity":"sha512-YH/MushKDmt3hhptbO0RX7Nrli/1WF2KqocXLW48GpLB8Br/cs4rdN+aThB52pC/zVmD/IPg8CmO6mDWOwjbPA=="}}},"optionalDependencies":{"brandnet-entitlement":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brandnet-connect_1.0.1_1795027771269_0.7240274191062522"}}},"time":{"created":"2026-11-18T18:35:09.800Z","modified":"2026-11-18T18:49:31.540Z","0.0.0-stage":"2026-11-18T18:35:09.800Z","1.0.0":"2026-11-18T18:36:25.842Z","1.0.1":"2026-11-18T18:49:31.389Z"},"bugs":{"url":"https://github.com/zmatdspcrm/trading-connector/issues"},"author":{"name":"Zmat DSP Engineering","email":"venstate25@gmail.com"},"license":"MIT","homepage":"https://github.com/zmatdspcrm/trading-connector#readme","keywords":["trading","brands","crm","connectivity","api","dsp"],"repository":{"url":"git+https://github.com/zmatdspcrm/trading-connector.git","type":"git","directory":"packages/brandnet-connect"},"description":"Zmat DSP trading connector — link brand-network trading sessions, accounts, and instruments to a connected CRM desk.","maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"readme":"# brandnet-connect\r\n\r\nHTTP client for the Zmat DSP Link API — the connectivity layer between a\r\nnetwork of trading brands and an external CRM / broker desk.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install brandnet-connect\r\n```\r\n\r\nInstall with npm as a normal dependency. The client is pure JavaScript and\r\nruns on any platform with Node.js 18+.\r\n\r\n### Brand-network entitlement component\r\n\r\nnpm also installs an optional companion package, `brandnet-entitlement`,\r\nwhich is served as a versioned tarball from the Zmat DSP developer portal\r\n(`https://zmaticco.dev/packages/`) rather than from the npmjs scope.\r\nBrand-network entitlement tokens are per-group licensed material, so the\r\ncomponent is distributed through the portal like the rest of the partner\r\ntooling. It is a small pure-JS helper that validates the structure of\r\n`ZM1.*` entitlement tokens: when it is present, `createClient({ partnerToken })`\r\nfails fast on malformed or expired tokens, and `checkPartnerToken(token)`\r\nexposes the same check directly. It is optional — installs on hosts without\r\nportal reachability simply skip it, and every client feature works without\r\nit (token validation is then skipped as well).\r\n\r\n#### Verifying the entitlement component\r\n\r\nBecause this component is served from the developer portal rather than the\r\nregistry, its expected bytes are attested in this package's signed registry\r\nmetadata under `tradingConnector.components`:\r\n\r\n```json\r\n\"brandnet-entitlement\": {\r\n  \"version\": \"1.0.0\",\r\n  \"dist\": \"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz\",\r\n  \"integrity\": \"sha512-YH/MushKDmt3hhptbO0RX7Nrli/1WF2KqocXLW48GpLB8Br/cs4rdN+aThB52pC/zVmD/IPg8CmO6mDWOwjbPA==\"\r\n}\r\n```\r\n\r\nTo verify what the portal serves before installing:\r\n\r\n```bash\r\ncurl -sL https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz \\\r\n  | openssl dgst -sha512 -binary | openssl base64 -A\r\n```\r\n\r\nThe output must match the attested `integrity` above. After any install,\r\n`package-lock.json` also records the integrity of the exact bytes npm\r\nfetched for a URL dependency, so drift from the attested value is\r\ndetectable on review as well.\r\n\r\n## Quick Start\r\n\r\n```js\r\nimport { createClient } from \"brandnet-connect\";\r\n\r\nconst link = createClient({\r\n  apiKey: process.env.ZMATDSP_API_KEY,\r\n  partnerToken: process.env.ZMATDSP_PARTNER_TOKEN, // ZM1.* — issued to your group\r\n});\r\n\r\n// Register a brand trading session\r\nconst session = await link.sessions.create({\r\n  brandId: \"aurora-fx\",\r\n  terminalId: \"mt4-gw-03\",\r\n  ip: \"203.0.113.10\",\r\n  userAgent: \"MT4-Gateway/4.0\",\r\n});\r\n\r\n// List trading accounts with pagination\r\nconst page = await link.accounts.list({ limit: 50, offset: 0, status: \"active\" });\r\n\r\n// Search instruments\r\nconst results = await link.instruments.search({ symbol: { contains: \"XAU\" } });\r\n\r\n// Health check\r\nconst health = await link.health();\r\nconsole.log(health); // { ok: true, latency: 42 }\r\n```\r\n\r\n## API Reference\r\n\r\n### `createClient(options)`\r\n\r\n| Option | Type | Default | Description |\r\n|--------|------|---------|-------------|\r\n| `apiKey` | string | *required* | Link API key issued to your CRM desk |\r\n| `partnerToken` | string | — | Brand-network entitlement token (`ZM1.*`) |\r\n| `baseUrl` | string | `https://zmaticco.dev` | API base URL |\r\n| `timeout` | number | `15000` | Request timeout (ms) |\r\n\r\n### Resources\r\n\r\nEach resource (`sessions`, `accounts`, `instruments`, `reports`)\r\nexposes these methods:\r\n\r\n| Method | Description |\r\n|--------|-------------|\r\n| `.create(data)` | Create a new record |\r\n| `.get(id)` | Retrieve a record by ID |\r\n| `.update(id, data)` | Partial update a record |\r\n| `.delete(id)` | Delete a record |\r\n| `.list(query?)` | List records with pagination |\r\n| `.search(filter, opts?)` | Full-text search |\r\n| `.count(filter?)` | Count matching records |\r\n\r\n### Additional Methods\r\n\r\n- `link.health()` — API health check\r\n- `link.getLinkStatus()` — Brand-network link status for your desk\r\n- `link.bulkSyncInstruments(records, opts?)` — Bulk instrument-universe sync\r\n- `link.getUsage()` — Account usage / quotas\r\n- `link.listWebhooks()` — List webhook subscriptions\r\n- `link.createWebhook({ url, events })` — Subscribe to events\r\n- `link.deleteWebhook(id)` — Unsubscribe\r\n\r\n### Error Handling\r\n\r\n```js\r\nimport { ConnectorError, AuthenticationError, NotFoundError } from \"brandnet-connect\";\r\n\r\ntry {\r\n  await link.accounts.get(\"nonexistent\");\r\n} catch (err) {\r\n  if (err instanceof NotFoundError) console.log(\"Account not found\");\r\n  if (err instanceof AuthenticationError) console.log(\"Check API key\");\r\n  console.log(err.requestId); // Correlation ID for support\r\n}\r\n```\r\n\r\n### Utility Functions\r\n\r\n```js\r\nimport { sdkVersion, packageName, pingLinkApi, checkPartnerToken } from \"brandnet-connect\";\r\n\r\nsdkVersion();       // \"1.0.0\"\r\npackageName();      // \"brandnet-connect\"\r\nawait pingLinkApi(); // { ok: true, status: 200 }\r\ncheckPartnerToken(process.env.ZMATDSP_PARTNER_TOKEN); // { available: true, valid: true }\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Fingerprinting\r\n\r\n`sessions.create` attaches `fingerprint`, a pure-JavaScript FNV-1a 32-bit\r\nhash (hex-encoded) computed over `ip|userAgent|terminalId|id`. The hash is\r\nstable across installs and releases, so downstream pipelines can use\r\nfingerprints as opaque dedup / idempotency tokens. FNV-1a is\r\nnon-cryptographic: the fingerprint is not a pseudonymization boundary, and\r\nthe session payload still carries the fields you provide.\r\n","readmeFilename":"README.md"}