2022-09-14 17:50:34 +02:00
|
|
|
# Budibase Public API SDK
|
|
|
|
JS SDK for the Budibase Public API.
|
|
|
|
|
|
|
|
This SDK is generated by [swagger-codegen](https://github.com/swagger-api/swagger-codegen).
|
|
|
|
|
2022-09-15 16:17:19 +02:00
|
|
|
Docker is used to run the generator, so Java is not required. Docker is the only requirement to generate the SDK.
|
|
|
|
|
|
|
|
The generated code will only run in a browser. It is not currently useable in a NodeJS environment.
|
|
|
|
|
|
|
|
## Example usage
|
|
|
|
```js
|
|
|
|
import { configure, ApplicationsApi } from "@budibase/sdk"
|
|
|
|
|
|
|
|
// Configure the API client
|
|
|
|
configure({
|
|
|
|
apiKey: "my-api-key",
|
|
|
|
host: "https://my.budibase.app"
|
|
|
|
})
|
|
|
|
|
|
|
|
// Search for an app.
|
|
|
|
// We can use the promisified version...
|
|
|
|
const res = await ApplicationsApi.applicationsSearchPost({ name: "foo" })
|
|
|
|
console.log("Applications:", res.data)
|
|
|
|
|
|
|
|
// ...or the callback version
|
|
|
|
ApplicationsApi.applicationsSearchPost({ name: "foo" }, ((error, data) => {
|
|
|
|
if (error) {
|
|
|
|
console.error("Failed to search:", error)
|
|
|
|
} else {
|
|
|
|
console.log("Applications:", data.data)
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
```
|