UNPKG

solobase-js

Version:

A 100% drop-in replacement for the Supabase JavaScript client. Self-hosted Supabase alternative with complete API compatibility.

73 lines 1.87 kB
import { SolobaseFetch } from './lib/fetch.js'; /** * Subscription management client for handling user subscriptions */ export declare class SolobaseSubscriptionClient { private fetch; constructor(fetch: SolobaseFetch); /** * Check user's subscription status * Returns active subscriptions for the authenticated user */ check(): Promise<{ data: any; error: { message: string; details: string; hint: string; code: string; } | null; status: number; statusText: string; }>; /** * Create a new subscription */ create(subscription: { plan_id: string; starts_at: string; expires_at: string; payment_reference?: string; auto_renew?: boolean; }): Promise<{ data: any; error: { message: string; details: string; hint: string; code: string; } | null; status: number; statusText: string; }>; /** * Cancel a subscription */ cancel(subscriptionId: string, cancellationReason?: string): Promise<{ data: any; error: { message: string; details: string; hint: string; code: string; } | null; status: number; statusText: string; }>; /** * Get all subscriptions for the user (uses the standard table query) * This allows using .from('subscriptions') in the standard way */ list(): Promise<{ data: any; error: { message: string; details: string; hint: string; code: string; } | null; status: number; statusText: string; }>; } //# sourceMappingURL=SolobaseSubscriptionClient.d.ts.map