https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

Roman

03/12/2023, 6:03 PM
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

Joffrey

03/12/2023, 6:04 PM
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

ephemient

03/13/2023, 1:07 AM
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
4 Views