How do I join tables that don't have a foreign key relationship with JS

I'm effectively trying to copy this SQL query
SELECT profiles.name, stories.title, stories.description, stories.created_on FROM stories INNER JOIN profiles on profiles.id = stories.user
into the javascript api. profiles and stories don't have a foreign key relationship but profiles.id and stories.user both reference auth.users.id
Was this page helpful?