Because it is a backend api which can only be imported on a backend file. You are trying to import it on a public file. Read this article for a better understanding of how to call backend functions from page.
Because it is a backend api which can only be imported on a backend file. You are trying to import it on a public file. Read this article for a better understanding of how to call backend functions from page.