How to get data from /pages/api in plasmic's data explorer?

When I create an API endpoint like so:
image

and want to reference the data as I can reference props, data sources etc in Plasmic as usual, how do I do that? Do I create /api/endpointhere as a data source?

The reason I ask is because I’ve connected Plasmic to Supabase auth and can’t reference my supabase table by UUID, only by email. I wanted to expose the UUID so I could fetch data by primary key rather than the whole table and filtering by email.

  • Is it okay to simply query by email? AFAIK, that’s a lot of wasted data being called, and also potentially less secure?
  • Is referencing Supabase rows by email totally fine? In which case I’ll just do that.

I modified my API to include the UUID, so I suppose an ideal method would be to get that into my custom properties so I can reference it there?

Hi, I’m not entirely sure I follow but if your postgres table contains a column for email, you can certainly filter by that!

Ok that’s fine! Is filtering by email inherently any less secure than UUID or not good practice? I read something to that effect online, as emails are more straightforward to spoof or something like that.

If it’s fine to filter by email, then that’s awesome and I’ll go ahead with it. For clarity, I’m trying to update user info so just wanted to make sure it doesn’t go wrong.