-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem:
Trying to create a separate plugin file which returns a plugin that registers fastifySupabase. Looks like the following:
import { SupabaseClientOptions } from '@supabase/supabase-js'
import fastifySupabase from '@psteinroe/fastify-supabase'
import fp from 'fastify-plugin'
type FastifySupabasePluginOpts = {
url: string
serviceKey: string
anonKey: string
options?: SupabaseClientOptions<'public'>
}
export default fp<FastifySupabasePluginOpts>(async (fastify, opts) => {
fastify.register(fastifySupabase, {
url: opts.url,
anonKey: opts.anonKey,
serviceKey: opts.serviceKey,
// you can pass any `SupabaseClientOptions`
options: opts.options
})
})
A potential solution:
Would help if the type FastifySupabasePluginOpts was also exported so that we can use it like
import fastifySupabase, { FastifySupabasePluginOpts } from '@psteinroe/fastify-supabase'
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request