Yes! YAML definitions will be automatically converted to JSON when they're fetched.
At the moment it does not. If you wish to use an API that has a Swagger 2.0 file, you'll need to first convert it to an OpenAPI 3 definition.
No! Since v4 is still in the early planning stages we don't support it but once it's finalized we will.
Not yet, unfortunately. For APIs that use OAuth 2, you'll need a fully-qualified token already for
api to make requests.
Not yet! This is something we're thinking about how to handle, but it's difficult with the simplified nature of the
.auth() method as it by design does not ask the user to inform the SDK of what kind of authentication scheme the token they're supplying it should match up against.
If you have ideas on how to handle this we'd love to hear them.
Yes! However because
multipart/form-data requests and uploading files to APIs you may need to polyfill the
fs module in your toolchain. If you're having trouble getting autogenerated SDKs working in a browser please let us know!
Not yet! This is something we're thinking about in the future.
Not yet! The URL that you give the module must be publicly accessible. If it isn't, you can download it to your computer or server and then use the absolute path to that file instead.
$ npx api install ./path/to/downloaded.json
const sdk = require('api')('./path/to/downloaded.json');
See How does it work? for some information on how, when, and where
api caches its data.
Updated 3 months ago