import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
erpnext: {
type: "app",
app: "erpnext",
}
},
async run({steps, $}) {
return await axios($, {
url: `${this.erpnext.$auth.base_url}/api/method/frappe.auth.get_logged_user`,
auth: {
username: `${this.erpnext.$auth.api_key}`,
password: `${this.erpnext.$auth.api_secret}`,
},
})
},
})
ERPNext uses API keys for authentication. When you connect your ERPNext account, Pipedream securely stores the keys so you can easily authenticate to ERPNext APIs in both code and no-code steps.
Your Frappe Base URL is https://{your frappe instance} (for example: https://demo.erpnext.com)
Please see these instructions to generate an API Key and API Secret.