mirror of
https://github.com/fergalmoran/supanextail.git
synced 2025-12-22 09:17:54 +00:00
18 lines
504 B
JavaScript
18 lines
504 B
JavaScript
import { createClient } from "@supabase/supabase-js";
|
|
|
|
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
|
|
|
|
export const supabase = createClient(supabaseUrl, supabaseAnonKey);
|
|
|
|
// Check if a user has a paid plan
|
|
export const getSub = async () => {
|
|
let { data: subscriptions, error } = await supabase
|
|
.from("subscriptions")
|
|
.select("paid_user, plan")
|
|
.single();
|
|
if (subscriptions) {
|
|
return subscriptions;
|
|
}
|
|
};
|