feat: add @polar-sh/sveltekit (#539)
* feat add @polar-sh/sveltekit * remove all lemonsqueezy text
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { dev } from '$app/environment';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import { CustomerPortal } from '@polar-sh/sveltekit';
|
||||
|
||||
export const GET = CustomerPortal({
|
||||
accessToken: env.POLAR_ACCESS_TOKEN,
|
||||
getCustomerId: async (e) => e.url.searchParams.get('customerId')!,
|
||||
server: dev ? 'sandbox' : 'production'
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
import { dev } from '$app/environment';
|
||||
import { env } from '$env/dynamic/private';
|
||||
import { Checkout } from 'polar-sveltekit';
|
||||
import { Checkout } from '@polar-sh/sveltekit';
|
||||
|
||||
export const GET = ({ ...params }) => {
|
||||
const metadata = JSON.parse(params.url.searchParams.get('metadata') ?? '{}');
|
||||
@@ -7,7 +8,8 @@ export const GET = ({ ...params }) => {
|
||||
|
||||
const request = Checkout({
|
||||
accessToken: env.POLAR_ACCESS_TOKEN,
|
||||
successUrl
|
||||
successUrl,
|
||||
server: dev ? 'sandbox' : 'production'
|
||||
});
|
||||
|
||||
return request(params);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { env } from '$env/dynamic/private';
|
||||
import { getServerSupabase } from '$lib/utils/functions/supabase.server';
|
||||
import { cancelOrgPlan, createOrgPlan, updateOrgPlan } from '$lib/utils/services/org';
|
||||
import type { PolarWebhookPayload } from '$lib/utils/types/polar';
|
||||
import { Webhooks } from 'polar-sveltekit';
|
||||
import { Webhooks } from '@polar-sh/sveltekit';
|
||||
import { PLAN } from 'shared/src/plans/constants';
|
||||
|
||||
export const POST = Webhooks({
|
||||
|
||||
Reference in New Issue
Block a user