Custom integrations
Connect any outside API from its OpenAPI spec, and call it from your app without exposing the API key.
Connect any outside API from its OpenAPI spec, and call it from your app without exposing the API key.
Connectors cover popular services like Google Calendar and Slack. For any other API, add it from its OpenAPI spec (OpenAPI 3 or Swagger 2, in JSON or YAML). Custom integrations are part of Pro and Pro+.
https://api.example.com/openapi.json, or paste the spec.WEATHER_API_KEY. When the spec says how, Draftship fills in the header or parameter name.Each integration gets a short name, such as weather-api, and lists its operations. You can change the key settings or remove it later.
Ask the AI in the chat, for example "Show the 3-day forecast for the city the user types, using the Weather API integration." The AI sees the operations and writes the calls for you. In code, a call looks like this:
const r = await ds.integrations.Custom.call("weather-api", "getForecast", {
params: { city: "Lisbon", days: 3 },
});
if (r.ok) console.log(r.data);
params holds the operation's path, query and header parameters by name; body is sent as JSON to operations that take one. The answer is { status, ok, data }.
An app can have up to 20 custom integrations, each with up to 300 operations.