Bindings overview
Workflows
The kinde.fetch
binding allows you to make external API calls including to the Kinde Management API.
If you are passing sensitive data we recommend you instead use kinde.secureFetch where the POST body is encrypted.
export const workflowSettings = { // ...other settings bindings: {"kinde.fetch": {}}};
The Kinde infrastructure library provides a type-safe fetch helper.
Note: you will also need the url binding enabled for the workflow as this is used under the hood.
import {fetch} from "@kinde/infrastructure";
export default async function Workflow(event) { const {data: ipDetails} = await fetch( `https://ipinfo.io/${event.request.ip}`, { method: "GET", responseFormat: "json", headers: {"Content-Type": "application/json"} } );
console.log(ipDetails);}
If you’re not using the infrastructure library, you can call the underlying API directly:
const res = await kinde.fetch(`https://ipinfo.io/${event.request.ip}`, { method: "GET", responseFormat: "json", headers: {"Content-Type": "application/json"}});const {json} = res;console.log(json);