Using zrok sdk without installing zrok and running enable cmd

I am using the zrok sdk.to create an app, to reduce the support I want to start the app without installing zrok and run the zrok enable command?

Hi @c4model, welcome to the community and to zrok (and OpenZiti/BrowZer)!

Exciting! What SDK are you using? I'd expect there to be a corresponding enable function that you could run but I'm not intimate with these sdks so maybe it's not there yet. Let us know what SDK you're using and we'll try to help.

1 Like

Hi @TheLumberjack, I am trying to use the golang sdk.

I first need to get the root environment root, err := environment.LoadRoot() before I can start a .NewListener to create an endpoint.

Can I skip the LoadRoot and pass in the auth token directly into the .NewListener?

Hey...

No, you can't currently skip the LoadRoot call as there is a Ziti identity involved in addition to the account token.

There is currently a backlog item to add the enable capability to the SDK directly:

However, in the meantime, if you're feeling adventurous, you could look at what the zrok enable command does and use the same calls directly in your code (assuming you're using golang). The same calls will be put behind a facade in the SDK when the above issue is implemented.

1 Like

Hi @michael.quigley, right now the if I use sdk, I need to first install zrok and run the zrok enable command, right?

I will take a look on the zrok enable command does.

No. Not at all. If you borrow the code from the zrok enable command:

...you will be able to do everything in your application without installing the zrok command.

1 Like

Thanks for the info @michael.quigley

1 Like