403 Forbidden Error upon trying to access Frappe JSON data in Vue App

Inside the vue app, i am using this method to call the data

const response = await fetch(
{ headers: { ‘Access-Control-Allow-Origin’: true } }
// const data = await response.json()

Using this in the Vue App to access a White-listed custom function in Hooks.py that returns the JSON data, It even works on localhost on the browser.

def test():
return frappe.get_meta(“Test For Actions”)

But while fetching it within the Vue app, it shows 403 Forbidden Error…
Is there any way to fix this, currently my Vue app is stored inside the frappe custom app…

@buildwithhussain @netchampfaris can you please give some insight?


Don’t you have to use user API key, where role give access to your moduleDef and doctype in the call, like explain in the doc ?


Figured it out, it was resolved by the following:

const clickFunction = async () => {
// const response = await import(
// ../../../hdfc/hdfc/doctype/individual_doc_test/${path}
// )
const response = await fetch(
headers: { ‘Access-Control-Allow-Origin’: true },
method: ‘GET’,
credentials: ‘include’,