{"id":29537917,"url":"https://github.com/openziti/ziti-sdk-nodejs","last_synced_at":"2026-04-28T00:05:01.657Z","repository":{"id":37790233,"uuid":"236522810","full_name":"openziti/ziti-sdk-nodejs","owner":"openziti","description":"An SDK for embedding zero trust into Node.JS applications and web servers to improve security.","archived":false,"fork":false,"pushed_at":"2026-02-09T21:51:15.000Z","size":675,"stargazers_count":81,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-02-10T01:39:27.175Z","etag":null,"topics":["appsec","javascript","netsec","node","nodejs","sdk","sdk-js","security","zero-trust","zero-trust-network","zero-trust-network-access","zero-trust-security","zerotrust","ztna"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openziti.png","metadata":{"files":{"readme":"README.hbs","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-27T15:29:46.000Z","updated_at":"2026-02-09T21:49:40.000Z","dependencies_parsed_at":"2024-03-23T22:23:17.009Z","dependency_job_id":"428c75dc-f5be-4afb-9d40-996d50d750b3","html_url":"https://github.com/openziti/ziti-sdk-nodejs","commit_stats":null,"previous_names":["netfoundry/ziti-sdk-nodejs"],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/openziti/ziti-sdk-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openziti","download_url":"https://codeload.github.com/openziti/ziti-sdk-nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openziti%2Fziti-sdk-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29373837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appsec","javascript","netsec","node","nodejs","sdk","sdk-js","security","zero-trust","zero-trust-network","zero-trust-network-access","zero-trust-security","zerotrust","ztna"],"created_at":"2025-07-17T04:43:10.901Z","updated_at":"2026-02-12T18:03:11.880Z","avatar_url":"https://github.com/openziti.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" width=\"100%\"\u003e\nOpenZiti is a free and open source project focused on bringing zero trust to any application.\n     \u003cbr\u003e\nThe project provides all the pieces required to implement or integrate zero trust into your solutions.\n\u003cbr/\u003e\n\u003cbr/\u003e\nPlease star us.\n\u003cbr/\u003e\n\u003ca href=\"https://github.com/openziti/ziti/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/openziti/ziti?style=flat\" \u003e\u003c/a\u003e\n\u003cbr/\u003e\n     \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" width=\"100%\"\u003e\n\u003ca href=\"https://openziti.io\"\u003e\u003cimg src=\"ziti.png\" width=\"100\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cb\u003e\n    \u003ca\u003e@openziti/ziti-sdk-nodejs\u003c/a\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cb\u003e\n    This repo hosts the OpenZiti SDK for NodeJS, and is designed to help you deliver secure applications over a \u003ca href=\"https://openziti.io\"\u003eOpenZiti Network\u003c/a\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cb\u003ePart of the \u003ca href=\"https://openziti.io/about\"\u003eOpenZiti\u003c/a\u003e ecosystem\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cb\u003eAre you interested in knowing how to easily embed programmable, high performance, zero trust networking into your NodeJS app, on any internet connection, without VPNs?\n    \u003cbr\u003e\n    Learn more about our \u003ca href=\"https://openziti.io/about\"\u003eOpenZiti\u003c/a\u003e project.\u003c/b\u003e\n    \u003cbr\u003e\n    \u003c/p\u003e\n\n---\n[![Build Status](https://github.com/openziti/ziti-sdk-nodejs/workflows/Build/badge.svg?branch=main)]()\n[![Issues](https://img.shields.io/github/issues-raw/openziti/ziti-sdk-nodejs)]()\n[![npm version](https://badge.fury.io/js/@openziti%2Fziti-sdk-nodejs.svg)](https://badge.fury.io/js/@openziti%2Fziti-sdk-nodejs.svg)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![LOC](https://img.shields.io/tokei/lines/github/openziti/ziti-sdk-nodejs)]()\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=rounded)](CONTRIBUTING.md)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n\n---\n\n# Associated Article(s)\nFor more context on this SDK, you may be interested in this\n[article concerning how to secure NodeJS applications](https://openziti.io/securing-nodejs-applications)\n\n\n\n# Supported platforms\n\nThe `@openziti/ziti-sdk-nodejs` module works with the following Node.js versions:\n- v12.x\n- v13.x\n- v14.x\n- v15.x\n- v16.x\n- v17.x\n- v18.x\n\nBinaries for most Node versions and platforms are provided by default via [@mapbox/node-pre-gyp](https://github.com/mapbox/node-pre-gyp).\n\n# Installing\n\nNPM\n``` js\nnpm i @openziti/ziti-sdk-nodejs\n```\nor Yarn\n``` js\nyarn add @openziti/ziti-sdk-nodejs\n```\n\nSpecial note on previous package:\n\nOn June 7, 2020 @openziti/ziti-sdk-nodejs@0.6.0 was released. Older, unscoped versions that are not part of the @openziti org are deprecated and only @openziti/ziti-sdk-nodejs will see updates going forward. To upgrade to the new package do:\n\n``` js\nnpm uninstall ziti-sdk-nodejs --save\nnpm install @openziti/ziti-sdk-nodejs --save\n```\n\n# Usage\n\n**Note:** the module must be [installed](#installing) before use.\n\nESM example (client-side)\n``` js\nimport ziti from '@openziti/ziti-sdk-nodejs';\n\n// Somehow provide path to identity file, e.g. via env var\nconst zitiIdentityFile  = process.env.ZITI_IDENTITY_FILE;\n// Authenticate ourselves onto the Ziti network\nawait ziti.init( zitiIdentityFile ).catch(( err ) =\u003e { /* probably exit */ });\n\nconst on_resp_data = ( obj ) =\u003e {\n    console.log(`response is: ${obj.body.toString('utf8')}`);\n};\n\n// Perform an HTTP GET request to a dark OpenZiti web service\nziti.httpRequest(\n  'myDarkWebService',            // OpenZiti Service name or HTTP origin part of the URL\n  'GET',\n  '/',                           // path part of the URL including query params\n  ['Accept: application/json' ], // headers\n  undefined,                     // optional on_req cb \n  undefined,                     // optional on_req_data cb\n  on_resp_data                   // optional on_resp_data cb\n);\n\n```\n\nESM example (server-side ExpressJS)\n``` js\nimport ziti from '@openziti/ziti-sdk-nodejs';\nimport express from 'express';\nlet app = ziti.express( express, zitiServiceName );\napp.listen(ignored, function() { ... }\n\n/**\n\nThat's right.\n\nWith only a single-line code change (the ziti.express call), your web server is now capable\nof being invisible to malicious attackers on the internet, and only accessible to your \ntrusted remote users.\n\nNothing else in your existing ExpressJS web server code needs to change!\n\nExisting routing, middleware, etc., all operates the same as it always did... \nbut now you enjoy the comfort of knowing that if a connection comes in, it is from \na trusted identity on the client side.\n\nNo malicious actors can see your dark web server, and thus, no malicious actors can attack it.\n\n*/\n```\n\nCJS example (client-side)\n``` js\nvar ziti = require('@openziti/ziti-sdk-nodejs');\n\nconst ziti_init = async (identity) =\u003e {\n    return new Promise((resolve) =\u003e {\n        ziti.ziti_init(identity, () =\u003e {\n            resolve();\n        });\n    });\n};\n\nconst ziti_service_available = (service) =\u003e {\n    return new Promise((resolve) =\u003e {\n        ziti.ziti_service_available(service, (status) =\u003e {\n            resolve(status);\n        });\n    });\n};\n\nfunction ziti_dial(service) {\n    return new Promise((resolve, reject) =\u003e {\n        ziti.ziti_dial(\n            service,\n            (conn) =\u003e {\n                resolve(conn);\n            },\n            (data) =\u003e {\n                // Do something with data...\n            },\n        );\n    });\n}\n\nconst ziti_write = (conn, data) =\u003e {\n    return new Promise((resolve) =\u003e {\n        ziti.ziti_write(conn, data, () =\u003e {\n            resolve();\n        });\n    });\n};\n\n(async () =\u003e {\n\n    await ziti_init(LOCATION_OF_IDENTITY_FILE);\n\n    let status = await ziti_service_available(YOUR_SERVICE_NAME);\n\n    if (status === 0) {\n\n        const conn = await ziti_dial(YOUR_SERVICE_NAME);\n\n        let data = SOME_KIND_OF_DATA;\n\n        let buffer = Buffer.from(data);\n\n        await ziti_write(conn, buffer);\n\n        ...etc\n    }\n\n})();\n```\n\n# API Reference\n{{#module name=\"@openziti/ziti-sdk-nodejs\"}}\n{{\u003ebody~}}\n{{\u003emember-index~}}\n{{\u003eseparator~}}\n{{\u003emembers~}}\n{{/module}}\n\n* * *\n\nGetting Help\n------------\nPlease use these community resources for getting help. We use GitHub [issues](https://github.com/openziti/ziti-sdk-nodejs/issues) \nfor tracking bugs and feature requests and have limited bandwidth to address them.\n\n- Read the [docs](https://openziti.github.io/ziti/overview.html)\n- Participate in discussion on [Discourse](https://openziti.discourse.group/)\n\n\nCopyright\u0026copy;  NetFoundry, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenziti%2Fziti-sdk-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenziti%2Fziti-sdk-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenziti%2Fziti-sdk-nodejs/lists"}