typescript
import { Hono } from 'hono'
import { createClient } from '@supabase/supabase-js'
type Variables = {
supabase: SupabaseClient
}
const app = new Hono<{ Variables: Variables }>()
app.use('*', async (c, next) => {
// Is this the right approach?
const supabase = createClient(
'SUPABASE_URL',
'SUPABASE_KEY'
)
c.set('supabase', supabase)
await next()
})
typescript
import { Hono } from 'hono'
import { createClient } from '@supabase/supabase-js'
type Variables = {
supabase: SupabaseClient
}
const app = new Hono<{ Variables: Variables }>()
app.use('*', async (c, next) => {
// Is this the right approach?
const supabase = createClient(
'SUPABASE_URL',
'SUPABASE_KEY'
)
c.set('supabase', supabase)
await next()
})