Frontend client
Create implementation and type files that exposes a client for a remote OpenAPI server, that uses fetch
and can run in any browser.
Generating the Client
To create a client for a remote OpenAPI API, use the following command:
$ platformatic client http://example.com/to/schema/file --frontend --language <language> --name <clientname>
<language>
: Can be eitherjs
(JavaScript) orts
(TypeScript).<clientname>
: The name of the generated client files. Defaults toapi
.
This command creates two files: clientname.js
(or clientname.ts
) and clientname-types.d.ts
for TypeScript types.