Hi,
I'm trying to use the example of the ziti-sdk-nodejs for getting started with the browser version (ziti-sdk-js), but I got the error "zitiConfig is not defined".
Here is the snippet:
import ziti from '@openziti/ziti-sdk-js';
async function getServerStatus(serverUrl: string) {
// Somehow provide path to identity file, e.g. via env var
const zitiIdentityFile = process.env.ZITI_IDENTITIES;
// Authenticate ourselves onto the Ziti network
await ziti.init(zitiIdentityFile).catch((err) => { /* probably exit */ });
}
I set the environment var ZITI_IDENTITIES to the path of my identity json and tested it with the Python SDK. So this connection basically works. Could you please give me a hint?
As you can see by the commit history, the ziti-sdk-js has been dormant for a couple years. This particular SDK should not be considered viable at this time.
It will most likely be reborn as ziti-sdk-browser (yes, spelled with an s not a z). This would be the SDK to manually embed within your web app, if you elected not to use our automatic web-app-Zitification enabled by the broader browZer stack.
thanks for the quick response. I'm trying to create a plugin for Obsidian (GitHub - obsidianmd/obsidian-sample-plugin) which is based on TypeScript and makes API calls to a zitified service. It seems that Obsidian is using an internal browser view to render its content, this is why I can't use the ziti-skd-nodejs package. If I understand you correctly the mentioned package ziti-sdk-browser isn't released yet? What else could I try to reach my zitified API service?
If Obsidian uses an embedded V8/JavaScript engine (i.e. not Node, but just V8) to execute plugins, then for the scenario you described, you would need the futureziti-sdk-js or ziti-sdk-browser to facilitate doing requests to a remote/protected Ziti Service.
I like where you're headed here, btw. Sounds like a cool plugin.
OK, I did some Electron-based Ziti prototypes a while back (like the ziti-sdk-js, those items are a bit dusty right now). When I get a chance to examine Obsidian more closely, I'll come at it from the Electron angle.