Frequently Asked Questions FAQ
What is a type-safe API?
In traditional development, the backend engineer writes the API and writes the relevant documents. Then, the frontend developer writes the request API function based on the documentation.
However, in type-safe API development, once the backend API is finished, the frontend merely needs to install the API module and import the API function, eliminating the need for any manual wrap code.
Is tsdk production ready?
Yes! tsdk has worked on the API for several years resulting in a streamlined process. If you have experience using Express.js in production, you will have no difficulties using tsdk in production.
What's the difference between tRPC and tsdk?
Both tRPC and tsdk can do type-safe API development, but they are implemented differently and offer different other features.
In short, tRPC is great, while tsdk provides another option.
In short, tRPC is great, while tsdk provides another option.
Next.js Server Actions are already type-safe, do we need tsdk?
If your front-end and back-end code can be written inside Next.js, you don't need to use tsdk; when you need to separate front-end and back-end services, you can use tsdk.
Compare GraphQL and tsdk?
GraphQL, is a data query language, and tsdk is a lightweight library for sharing code and developing type-safe APIs. They are different things.
What are the cons and pros of tsdk so far?
Cons:
1. API configuration cannot be duplicated;
2. The steps are relatively tedious: define the API configuration (API Config) -> setup the API with config -> and run the scripts sync module.
Pros:
1. Because API are based on configurations, which are equivalent to the core data of the API, they are more flexible;
2. Support share code;
3. Codegen: API functions exports, and SWR or React Query Hooks generate.
1. API configuration cannot be duplicated;
2. The steps are relatively tedious: define the API configuration (API Config) -> setup the API with config -> and run the scripts sync module.
Pros:
1. Because API are based on configurations, which are equivalent to the core data of the API, they are more flexible;
2. Support share code;
3. Codegen: API functions exports, and SWR or React Query Hooks generate.
More questions
If you have any other questions or suggestions, feel free to contact us atissueOr join thediscussions