S
Supabase9mo ago
Grady

How do you see the logging that I created?

I created loggings in my APIs, and I'm not sure where do I see it in Supabase
9 Replies
garyaustin
garyaustin9mo ago
What are APIs in your context? Supabase has logs for activity in the logs section of the dashboard.
Grady
GradyOP9mo ago
the APIs are my own endpoints
Grady
GradyOP9mo ago
Gist
gist:0153b5812453ab15d41d0581ddf9bec8
GitHub Gist: instantly share code, notes, and snippets.
Grady
GradyOP9mo ago
i added some logging and on that fetch(new URL('/api/snaptrade/register', request.url), { API call, I also added some logging
garyaustin
garyaustin9mo ago
Supabase is not involved with your client/server side code. You can see the calls to Supabase in the API Gateway logs and log from Postgres functions or Edge functions. So the console.logs you show in that link will all be in your development environment.
Grady
GradyOP9mo ago
I'm trying to figure out why this doesn't get called any advise on how do I see the logs?
garyaustin
garyaustin9mo ago
That call is to your own code or some other api not to Supabase. If you are using a framework you can maybe post that here, but it is really not a Supabase thing on how to get logs in your framework. Maybe some user has feedback for you for that framework.
Grady
GradyOP9mo ago
ok I figured it out, I can see the log from Vercel
const supabase = createRouteHandlerClient({ cookies })
await supabase.auth.exchangeCodeForSession(code)

// Add debug logging
console.log('Processing auth callback with code:', code)

try {
const { data: { user } } = await supabase.auth.getUser()
console.log('User data:', user) // Log the user data
const supabase = createRouteHandlerClient({ cookies })
await supabase.auth.exchangeCodeForSession(code)

// Add debug logging
console.log('Processing auth callback with code:', code)

try {
const { data: { user } } = await supabase.auth.getUser()
console.log('User data:', user) // Log the user data
how do I get the user after they confirm the email?
Terry
Terry9mo ago
Looks like you're using Next? Did you start with npx create-next-app -e with-supabase? That should provide enough direction to get a working example going of how that should work

Did you find this page helpful?