Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the ability to use @nuxtjs/supabase with Clerk #322

Open
9M6 opened this issue Dec 31, 2023 · 0 comments
Open

Adding the ability to use @nuxtjs/supabase with Clerk #322

9M6 opened this issue Dec 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@9M6
Copy link

9M6 commented Dec 31, 2023

Is your feature request related to a problem? Please describe.

Clerk is an Authentication as a Service and they provide libraries to delegate authentication, they also integrate well with Supabase, since there're some use-cases where we don't really need Supabase Auth but instead, we require something more complicated and comprehensive.

Clerk provides some libraries, for Vue there's a community-maintained library, but there's no nuxt plugin. I tried to combine the vue-clerk with @nuxtjs/supabase but it did not really work, or it requires some hard-coding, and the use of createClient from the native supabase-js library.

Describe the solution you'd like

In the clerk integration example clerk docks on supabase, we need to pass a Bearer Token to the config of the supabase-js createClient

const supabaseClient = async (supabaseAccessToken) => {
    const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_KEY, {
      global: { headers: { Authorization: `Bearer ${supabaseAccessToken}` } },
    });
    // set Supabase JWT on the client object,
    // so it is sent up with all Supabase requests
    return supabase;
  };

I think if we could have this ability on the @nuxtjs/supabase library by default that would be awesome. I know we can configure it on our own using the nuxt.config.ts files, but the problem here is that clerk gives a dynamic token depending on the user tho has authenticated, and which must be included every time.

Describe alternatives you've considered

N/A

Additional context

N/A

@9M6 9M6 added the enhancement New feature or request label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant