{"_id":"@computer-cloud/n8n-license-sdk","_rev":"4-c842725398c8073e3aacf8bba6542adf","name":"@computer-cloud/n8n-license-sdk","dist-tags":{"latest":"2.24.4"},"versions":{"2.24.1":{"name":"@computer-cloud/n8n-license-sdk","version":"2.24.1","keywords":[],"author":{"url":"https://ai.cs.ac.cn","name":"Mr.YAO","email":"n8n@mryao.org"},"license":"UNLICENSED","_id":"@computer-cloud/n8n-license-sdk@2.24.1","maintainers":[{"name":"imryao","email":"npm@mryao.org"}],"dist":{"shasum":"c8581e471d928e1141bf7487db60c3b1660ea4b2","tarball":"https://registry.npmjs.org/@computer-cloud/n8n-license-sdk/-/n8n-license-sdk-2.24.1.tgz","fileCount":16,"integrity":"sha512-8OJGA7g3FkfrbPKVz6b5bQmPuIffYjNJXA93UzDe5eXDFMnXnH7aVj6zo2T3JXJWP4YWO3VvhOTfZq1/6bJ5qw==","signatures":[{"sig":"MEQCIDP6cAFG51Xjhf3HhplaydMrSae5COej2nUvsJbrP+/mAiACZ/77luvobQ6OhFgwn7CSA3pB+Bg3acJRa/LrU85Vkw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":187967},"main":"dist/LicenseManager.js","tsup":{"dts":false,"clean":true,"entry":["src/LicenseManager.ts","src/httpRequest.ts"],"format":["esm","cjs"],"minify":true,"sourcemap":true,"splitting":false,"experimentalDts":true},"types":"dist/LicenseManager.d.ts","engines":{"node":">=18.12.1"},"scripts":{"test":"jest --collectCoverage -t '.*'","build":"tsup","prepublish":"tsup","publishToNpm":"pnpm publish --access public --no-git-checks","incrementVersion":"npm version from-git --git-tag-version false"},"_npmUser":{"name":"imryao","email":"npm@mryao.org"},"_npmVersion":"11.6.2","description":"License SDK","directories":{},"_nodeVersion":"25.2.1","dependencies":{"undici":"^7.16.0","node-rsa":"^1.1.1","crypto-js":"^4.2.0","node-machine-id":"^1.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.4.0","@types/node-rsa":"^1.1.4","@types/crypto-js":"^4.2.2","@n8n_io/license-server":"1.0.0","@microsoft/api-extractor":"^7.53.0"},"_npmOperationalInternal":{"tmp":"tmp/n8n-license-sdk_2.24.1_1763828831332_0.7915656009614569","host":"s3://npm-registry-packages-npm-production"}},"2.24.2":{"name":"@computer-cloud/n8n-license-sdk","version":"2.24.2","keywords":[],"author":{"url":"https://ai.cs.ac.cn","name":"Mr.YAO","email":"n8n@mryao.org"},"license":"UNLICENSED","_id":"@computer-cloud/n8n-license-sdk@2.24.2","maintainers":[{"name":"imryao","email":"npm@mryao.org"}],"dist":{"shasum":"3d58acf431d2c5b9abbc871461bf901ff319c4a7","tarball":"https://registry.npmjs.org/@computer-cloud/n8n-license-sdk/-/n8n-license-sdk-2.24.2.tgz","fileCount":16,"integrity":"sha512-4H37xAbBLtUDqDOLUV/VO2yUpPTzW3HlhSdyXfO3RPyRTezaoo+62E/Ul8RCEP+kdkjZtI9tVUarg8xyoWIHnw==","signatures":[{"sig":"MEUCIQDwl2oPnoK/pJD6dhT0YF6OjNcvsU4xV+8XzoArZr31mgIgIkQzQBvVScvtct6IwH6gM1HP24HLHUr6DgaJbQ0XSPI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":186572},"main":"dist/LicenseManager.js","tsup":{"dts":false,"clean":true,"entry":["src/LicenseManager.ts","src/httpRequest.ts"],"format":["esm","cjs"],"minify":true,"sourcemap":true,"splitting":false,"experimentalDts":true},"types":"dist/LicenseManager.d.ts","engines":{"node":">=18.12.1"},"gitHead":"2d248fdb505bd677c7c58bc5a1246032346f3c1c","scripts":{"test":"jest --collectCoverage -t '.*'","build":"tsup","prepublish":"tsup","publishToNpm":"pnpm publish --access public --no-git-checks","incrementVersion":"npm version from-git --git-tag-version false"},"_npmUser":{"name":"imryao","email":"npm@mryao.org"},"_npmVersion":"11.6.2","description":"License SDK","directories":{},"_nodeVersion":"25.2.1","dependencies":{"undici":"^7.16.0","node-rsa":"^1.1.1","crypto-js":"^4.2.0","node-machine-id":"^1.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.4.0","@types/node-rsa":"^1.1.4","@types/crypto-js":"^4.2.2","@microsoft/api-extractor":"^7.53.0"},"_npmOperationalInternal":{"tmp":"tmp/n8n-license-sdk_2.24.2_1763867060078_0.2995942790056667","host":"s3://npm-registry-packages-npm-production"}},"2.24.3":{"name":"@computer-cloud/n8n-license-sdk","version":"2.24.3","keywords":[],"author":{"url":"https://ai.cs.ac.cn","name":"Mr.YAO","email":"n8n@mryao.org"},"license":"UNLICENSED","_id":"@computer-cloud/n8n-license-sdk@2.24.3","maintainers":[{"name":"imryao","email":"npm@mryao.org"}],"dist":{"shasum":"919b9df6c1404d8b7782c50e1abeabbdc5948004","tarball":"https://registry.npmjs.org/@computer-cloud/n8n-license-sdk/-/n8n-license-sdk-2.24.3.tgz","fileCount":16,"integrity":"sha512-NgqWuIf/35awM4RG5hlBzWh6lwmVtUfpy+mk3AI8guxAEI5/L3ZrJIy2GYPq0wgOXUJMV4OHxo/cXrg8x0Cxjw==","signatures":[{"sig":"MEUCIGqtrWSuKTCB1rKnLXhMviIz2+FDuTZeR2oJmpn63obgAiEA84S05TIPny1ahEYWlnmKH9te/jqhL499j4mCx4D/ZHc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":182856},"main":"dist/LicenseManager.js","tsup":{"dts":false,"clean":true,"entry":["src/LicenseManager.ts","src/httpRequest.ts"],"format":["esm","cjs"],"minify":true,"sourcemap":true,"splitting":false,"experimentalDts":true},"types":"dist/LicenseManager.d.ts","engines":{"node":">=18.12.1"},"gitHead":"2d248fdb505bd677c7c58bc5a1246032346f3c1c","scripts":{"test":"jest --collectCoverage -t '.*'","build":"tsup","prepublish":"tsup","publishToNpm":"pnpm publish --access public --no-git-checks","incrementVersion":"npm version from-git --git-tag-version false"},"_npmUser":{"name":"imryao","email":"npm@mryao.org"},"_npmVersion":"11.6.2","description":"License SDK","directories":{},"_nodeVersion":"25.2.1","dependencies":{"undici":"^7.16.0","node-rsa":"^1.1.1","crypto-js":"^4.2.0","node-machine-id":"^1.1.12"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.4.0","@types/node-rsa":"^1.1.4","@types/crypto-js":"^4.2.2","@microsoft/api-extractor":"^7.53.0"},"_npmOperationalInternal":{"tmp":"tmp/n8n-license-sdk_2.24.3_1763884390366_0.4792727657249378","host":"s3://npm-registry-packages-npm-production"}},"2.24.4":{"name":"@computer-cloud/n8n-license-sdk","version":"2.24.4","description":"License SDK","main":"dist/LicenseManager.js","types":"dist/LicenseManager.d.ts","tsup":{"entry":["src/LicenseManager.ts","src/httpRequest.ts"],"splitting":false,"sourcemap":true,"dts":false,"experimentalDts":true,"clean":true,"minify":true,"format":["esm","cjs"]},"keywords":[],"author":{"name":"Mr.YAO","email":"n8n@mryao.org","url":"https://ai.cs.ac.cn"},"license":"UNLICENSED","engines":{"node":">=18.12.1"},"dependencies":{"crypto-js":"^4.2.0","node-machine-id":"^1.1.12","node-rsa":"^1.1.1","undici":"^7.16.0"},"devDependencies":{"@microsoft/api-extractor":"^7.53.0","@types/crypto-js":"^4.2.2","@types/node-rsa":"^1.1.4","tsup":"8.4.0"},"scripts":{"build":"tsup","incrementVersion":"npm version from-git --git-tag-version false","prepublish":"tsup","publishToNpm":"pnpm publish --access public --no-git-checks","test":"jest --collectCoverage -t '.*'"},"gitHead":"2d248fdb505bd677c7c58bc5a1246032346f3c1c","_id":"@computer-cloud/n8n-license-sdk@2.24.4","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-EQPV/uzq2N2GPQr3dLa7ojXZsZDtwoRFfFzmgpHdXj9so/IfgLKcYWiqVmMyn/nU8CoA/YgyV4dhnZzUsZnyVg==","shasum":"950c92d743da93a8c93155a55c3ad2a7d1f5baf1","tarball":"https://registry.npmjs.org/@computer-cloud/n8n-license-sdk/-/n8n-license-sdk-2.24.4.tgz","fileCount":16,"unpackedSize":182578,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDFORwxPPX7zAIwO6/z8OSUJjdB5EXrKzEM4Iu2k+e1qQIhAI9qApjRPJHYWC3jBcj2Q13L9E50h2KyEUfwugy6/G38"}]},"_npmUser":{"name":"imryao","email":"npm@mryao.org"},"directories":{},"maintainers":[{"name":"imryao","email":"npm@mryao.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-license-sdk_2.24.4_1763885817990_0.7552434928591543"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-22T16:27:11.264Z","modified":"2025-11-23T08:16:58.748Z","2.24.1":"2025-11-22T16:27:11.552Z","2.24.2":"2025-11-23T03:04:20.301Z","2.24.3":"2025-11-23T07:53:10.547Z","2.24.4":"2025-11-23T08:16:58.197Z"},"author":{"name":"Mr.YAO","email":"n8n@mryao.org","url":"https://ai.cs.ac.cn"},"license":"UNLICENSED","keywords":[],"description":"License SDK","maintainers":[{"name":"imryao","email":"npm@mryao.org"}],"readme":"# SDK\n\nThe SDK provides a convenient way to work with license keys issued by the n8n license-server.\n\n## Usage\n\n```typescript\nimport {\n  LicenseManager,\n  TLicenseBlock,\n} from '@n8n_io/license-sdk/src/LicenseManager'\nimport pino from 'pino'\n\n// bring your own logger, e.g. Pino, Winston etc.\nconst myLogger = pino()\n\n// ------ INITIALIZATION ------\n\nconst license = new LicenseManager({\n  server: 'https://license.your-server.com',\n  tenantId: 1, // referencing to resp. license-server entity\n  productIdentifier: 'Demo Product v1.2.3', // must regex-match cert.productIdentifierPattern\n  autoRenewEnabled: true,\n  renewOnInit: false,\n  autoRenewOffset: 60 * 60 * 48, // = 48 hours\n  logger: myLogger,\n  loadCertStr: async () => {\n    // code that returns a stored cert string from DB\n    return '...'\n  },\n  saveCertStr: async (cert: TLicenseBlock) => {\n    // code that persists a cert string into the DB\n    // ...\n  },\n  deviceFingerprint: () => 'a-unique-instance-id', //optional! If omitted, a machine-ID fingerprint will be generated\n  onFeatureChange: () =>\n    console.log('availability of some features has just changed'), //optional\n  onLicenseRenewed: () => console.log('license was successfully renewed'), //optional\n  onExpirySoon: () => console.log('license is about to expire'), //optional\n  expirySoonOffsetMins: 180, //optional\n})\n\n// important! Attempts to load and initialize the cert:\nawait license.initialize()\n\n// without a valid cert, no feature will be available:\nif (license.hasFeatureEnabled('a-special-feature')) {\n  // this code will never execute!\n}\n\nlicense.isValid() // -> false\n\nlicense.getFeatureValue('another-feature') // -> undefined\n\nlicense.getFeatures() // -> []\n\n// ------ ACTIVATION ------\n\ntry {\n  // download a license key by 'activating' a reservation.\n  // Reservations are typically configured to be activatable only once.\n  await license.activate('3fa85f64-5717-4562-b3fc-2c963f66afa6')\n\n  license.isValid() // -> true\n\n  license.getFeatureValue('foo') // -> 'bar'\n\n  if (license.hasFeatureEnabled('a-feature-that-exists')) {\n    //do stuff\n  }\n\n  const currentConsumption = getUsageFromSomewhere()\n\n  if (license.hasQuotaLeft('quota:demoQuota', currentConsumption)) {\n    //do stuff\n  }\n\n  // print a human-readable string representation.\n  console.log(`${license}`)\n} catch (e) {\n  // handle error...\n}\n\n// ------ RENEWAL ------\n// renewals happen automatically based on the config options `autoRenewEnabled` and `autoRenewOffset`\n// but can also be enforced, as long as the current cert is not yet terminated:\nawait license.renew()\n```\n","readmeFilename":"README.md"}