Like what we’re doing? Star us on GitHub!

Access Local API in Custom View

4 weeks ago

I am trying to access Payload Local Api in my custom view that is overwriting the "List" view of one collection, if I import payload and I try to access payload.find I get

payload__WEBPACK_IMPORTED_MODULE_1__.default.find is not a function
  • Jesse Sivonen
    4 weeks ago

    You cannot access Local API from front-end if I understood correctly. You must use either REST or GraphQL. In admin panel there might be some ready-made way to access the REST API. Maybe using React hooks?

  • Enrico
    4 weeks ago

    Now i understand, thank you

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More