Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: Autogenerated TypeScript types? #45

Open
jgb-solutions opened this issue Feb 6, 2025 · 6 comments
Open

[feat]: Autogenerated TypeScript types? #45

jgb-solutions opened this issue Feb 6, 2025 · 6 comments
Labels
issue: enhancement status: planned The feature or enhancement is planned in the roadmap

Comments

@jgb-solutions
Copy link

A clear and concise description of what the feature is

Strapi is very popular and it was time for it to have a SDK. I just tried it and it works but with no types, it's not very appealing to modern projects using TypeScript. I know I could use GraphQL but that's another big mental hurdle of its own.

Why should this feature be included?

Autogenerated TypeScript types from the API.

Please provide an example for how this would work

In modern frontend for web and mobile apps using TypeScript.

@innerdvations
Copy link
Contributor

That feature is on its way! We're currently testing a few different options for generating the types to find what works best, and are hoping to implement it in the coming weeks.

And thanks for your interest, it's great to see people already trying out the SDK.

@hanpaine
Copy link

hanpaine commented Feb 6, 2025

Hey @jgb-solutions thanks for your interest! This is just the beginning for our SDK. The full roadmap can be seen here: https://www.notion.so/strapi/Strapi-JavaScript-SDK-plan-15f8f35980748046b7f8fb207b29c64b

@jgb-solutions
Copy link
Author

Hey @hanpaine @innerdvations thanks guys for replying quickly. I was looking for this for a while and I've been using Strapi for a many years now. I stepped away a little bit because of the bad DX of fetching data. I'll keep looking for new releases of this package. Good job guys!

@Convly Convly added the status: planned The feature or enhancement is planned in the roadmap label Feb 6, 2025
@Convly
Copy link
Member

Convly commented Feb 17, 2025

Hey @jgb-solutions, I just wanted to keep you updated on this as you've expressed some interest on the subject 🙂

We've actually started the research and development for the generation of better types and APIs for the SDK. The research itself took quite some time but we're confident we're heading in the right direction and will soon be able to start the development.

We'll update you when we have more news to share about our progress!

Have a great day 🎉

@jgb-solutions
Copy link
Author

Hey @jgb-solutions, I just wanted to keep you updated on this as you've expressed some interest on the subject 🙂

We've actually started the research and development for the generation of better types and APIs for the SDK. The research itself took quite some time but we're confident we're heading in the right direction and will soon be able to start the development.

We'll update you when we have more news to share about our progress!

Have a great day 🎉

Thank you for the update @Convly. I appreciate it.

@fsbtmo
Copy link

fsbtmo commented Mar 4, 2025

Hi! Exciting news that your are actively developing this feature!

We currently use the Documentation plugin to generate types and api for our frontend. Some things come to mind, which currently don't work well:

  • almost all fields are nullable, so the "required" set in strapi is often ignored
  • no types for the RichText field
  • relations are not typed (only the properties id and documentId are inside a relation field -> would be nice to get a reference to the selected relation type of the field)

We are looking forward to try this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement status: planned The feature or enhancement is planned in the roadmap
Projects
None yet
Development

No branches or pull requests

5 participants