By running generate() you can create the full SDK based on your backend code. This will create helper functions like:
// [Auto-generated]
export const createCar = async (input: Car): Promise<Car & Instance> => {
// Validate input
// Run http request: POST [baseUrl]/car
// Validate output
// Handle errors
// Return output
};You generate the frontend code by calling the async generate() function.
await app.generate({
// An entry path to your TS types, so JS20 can rebuild them for frontend
entryPath: path.resolve('./src/examples/shared/advanced.ts'),
outputs: ['./dist/frontend.ts'],
baseUrl: 'http://localhost:3000',
});Which produces output like this, as well as the saved file that you can use in your frontend project:
