Back

generating typescript types on client side

  • 0
  • Tools
HoXsan
30 Aug, 2023, 15:43

Hi guys,

Is there a way to generate types on client side. Collection types and etc?

TL;DR
The user is asking if there is a way to generate typescript types on the client side. Another user suggests using Supabase to generate database types by running a command. However, the user is looking for a more automated solution and mentions struggling with a different tool. Another user suggests using Quicktype.io to generate types. Another user mentions manually generating the types. Finally, a user suggests looking into the "am" package by Wess. No clear solution is provided in the thread, but various tools and methods are suggested for generating typescript types on the client side.
Binyamin
30 Aug, 2023, 15:48

Take a look at Wess's am package

HoXsan
30 Aug, 2023, 20:30

I was thinking more auto generated like what supabase has: https://supabase.com/docs/guides/api/rest/generating-types

Guille
30 Aug, 2023, 21:16

No auto generated at the time, until now, I have manually generating it

Drake
31 Aug, 2023, 02:11

I often use https://quicktype.io/ to generate stuff like this

HoXsan
31 Aug, 2023, 02:13

Thanks guys. Was hoping for more automated way to generate it. Maybe something like: https://github.com/YsarocK/fetch-appwrite-types Couldn't make it work tho.

Drake
31 Aug, 2023, 02:25

We plan to add something once we find time. We have a lot of languages to add support for though 😬

HoXsan
31 Aug, 2023, 02:37

Oh, I thought AppWrite had great TS support :/

Drake
31 Aug, 2023, 02:46

Have you used this?

HoXsan
31 Aug, 2023, 02:49

Yes, you just do supabase gen types typescript --project-id $PROJECT_ID > lib/database.types.ts then it will put all the database types to the destination file.

HoXsan
31 Aug, 2023, 02:49

pretty convenient

Drake
31 Aug, 2023, 02:50

Hmm not sure why I was having problems when I tried it out a while ago

HoXsan
31 Aug, 2023, 02:53

Saw something post about supabase free tier being down? Not sure if that is the case

Drake
31 Aug, 2023, 02:53

Oh no. It was a while ago, not today

HoXsan
31 Aug, 2023, 02:55

Oh I see, not sure 😄

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more