smartive / zitadel-node

ZITADEL SDK for Node.js
https://www.npmjs.com/package/@zitadel/node
Apache License 2.0
15 stars 8 forks source link

Add support for API V2 or at least make it explicit which API version is being used #436

Open wlinna opened 1 month ago

wlinna commented 1 month ago

It is difficult to say what API version zitadel-node uses. It seems that the API is not versioned or anything. This also makes it difficult to ensure the correct behavior, because some endpoints work differently.

I tried to find V2 version of add human user from zitadel-node, but I couldn't. Perhaps V2 is not supported at all (?)

Could you please add support for V2 API (in addition to V1)? Or at least make it clear which API version is used.

tafaust commented 3 days ago

@wlinna From what I've seen, the current version 2.0.35 is using the Zitadel API v2. Here is the trace:

  1. Types are generated from protobuf via npm run build:grpc
  2. The npm script in 1. clones the path proto/zitadel from the Zitadel repository on main branch.
  3. The proto/zitadel path contains the v2 and v2beta. Here is an example for the user resource. Here is an example for your inquiry (add human user).

However, it is unclear to me if "v2beta === v3 (preview)". Maybe @eliobischof can give an informed answer here?

wlinna commented 3 days ago

Hello, thanks for answering. We / I switched to the JSON-based API though (because of this issue and maybe others. I don't remember anymore).

Regardless, I think the information should be made explicit in the API and in the README, because the API versions sometimes behave differently.

tafaust commented 1 day ago

@wlinna I think you can create something like this for yourself or PR to this repository.