© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•7d ago•
17 replies
Hekkow

How do I connect my currently existing code to my Supabase database?

🔢DB Connections🟢SQL
The code below is what I have right now on the server side and I'm not entirely sure how best to connect it to the database. Do I just do the same thing on the database then replicate it on the server? Do I even need the server at all if most of what I'm doing is just data manipulation, couldn't I just access the database directly from the client side, or is that a bad idea because of security? Sorry, very basic questions, I'm not sure where to learn more about this though.
supabase.auth.getUser(authToken).then(({data, error}) => {
        if (error || !data.user) {
            console.log(`Got error ${error?.message}`);
            return res.sendStatus(401);
        }
        let id: string = data.user.id;
        let user = users.get(id);
        if (!user) {
            user = new User(id);
            users.set(id, user);
        }
supabase.auth.getUser(authToken).then(({data, error}) => {
        if (error || !data.user) {
            console.log(`Got error ${error?.message}`);
            return res.sendStatus(401);
        }
        let id: string = data.user.id;
        let user = users.get(id);
        if (!user) {
            user = new User(id);
            users.set(id, user);
        }
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How do i overwrite existing files in my supabase bucket?
SupabaseSSupabase / help-and-questions
4y ago
How do I restore my database?
SupabaseSSupabase / help-and-questions
4mo ago
Connecting supabase to existing SQL database/ Microsoft Access
SupabaseSSupabase / help-and-questions
5mo ago
How to connect my Hpanel supabase to my react app
SupabaseSSupabase / help-and-questions
3mo ago