hey! I have a kotling spring app. And want to reu...
# getting-started
r
hey! I have a kotling spring app. And want to reuse client code of todoist api. It's written on typescript. Please tell if it's possible to call ts code from kt? To not spend time rewriting all the models by hands. Maybe you have some example or a draft of gradle configuration file? this module
npm install @doist/todoist-api-typescript
j
I am not sure I understand correctly, but if your goal is to use a typescript library in your JVM spring app, that's not possible (at least that's not how kotlin multiplatform works). Kotlin/JS needs to run in a JavaScript environment (browser or nodeJS), it cannot run on JVM
e
there are ways to host a JS environment inside the JVM like https://github.com/cashapp/zipline, but you still have to bridge everything over
since the Todoist API is simply REST, it would be much easier to simply interact with that from the JVM directly, possibly using Retrofit or Ktor