mirror of
https://github.com/HugeFrog24/shakethefrog.git
synced 2026-03-02 08:24:33 +00:00
Fuckaway Windows line endings
This commit is contained in:
@@ -16,20 +16,25 @@ export const appConfig = {
|
||||
id: 'frog',
|
||||
name: 'Frog',
|
||||
normal: '/images/frog.svg',
|
||||
shaken: '/images/frog-shaken.svg'
|
||||
shaken: '/images/frog-shaken.svg',
|
||||
isPremium: false
|
||||
},
|
||||
mandarin: {
|
||||
id: 'mandarin',
|
||||
name: 'Mandarin',
|
||||
normal: '/images/mandarin.svg',
|
||||
// TODO: Create a proper shaken version of the mandarin skin
|
||||
shaken: '/images/mandarin.svg' // Using the same image for both states until a shaken version is created
|
||||
shaken: '/images/mandarin.svg', // Using the same image for both states until a shaken version is created
|
||||
isPremium: false,
|
||||
variantId: 'your_mandarin_variant_id_here' // Replace with actual variant ID when created
|
||||
},
|
||||
beaver: {
|
||||
id: 'beaver',
|
||||
name: 'Beaver',
|
||||
normal: '/images/beaver.svg',
|
||||
shaken: '/images/beaver-shaken.svg'
|
||||
shaken: '/images/beaver-shaken.svg',
|
||||
isPremium: true,
|
||||
variantId: '1047017'
|
||||
}
|
||||
},
|
||||
defaultSkin: 'frog'
|
||||
|
||||
20
app/config/features.ts
Normal file
20
app/config/features.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Server-side feature flag definitions.
|
||||
*
|
||||
* Flags are read from environment variables. The abstraction is kept thin
|
||||
* so a runtime provider (Flipt, Unleash, Flags SDK adapter, etc.) can be
|
||||
* swapped in later without changing any consumer code.
|
||||
*
|
||||
* Convention: FEATURE_<NAME>=1 → enabled
|
||||
* anything else → disabled
|
||||
*/
|
||||
|
||||
export interface FeatureFlags {
|
||||
paymentsEnabled: boolean;
|
||||
}
|
||||
|
||||
export function getFeatureFlags(): FeatureFlags {
|
||||
return {
|
||||
paymentsEnabled: process.env.FEATURE_PAYMENTS === '1',
|
||||
};
|
||||
}
|
||||
45
app/config/lemonsqueezy.ts
Normal file
45
app/config/lemonsqueezy.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { lemonSqueezySetup } from '@lemonsqueezy/lemonsqueezy.js';
|
||||
|
||||
// Initialize Lemon Squeezy SDK
|
||||
export function initializeLemonSqueezy() {
|
||||
const apiKey = process.env.LEMONSQUEEZY_API_KEY;
|
||||
|
||||
if (!apiKey) {
|
||||
throw new Error('LEMONSQUEEZY_API_KEY is required');
|
||||
}
|
||||
|
||||
lemonSqueezySetup({
|
||||
apiKey,
|
||||
onError: (error) => {
|
||||
throw error; // Fail fast instead of just logging
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Lemon Squeezy configuration with lazy validation.
|
||||
// Config is only resolved on first access so the module can be safely
|
||||
// imported even when payment env vars are absent (e.g. payments disabled).
|
||||
let _config: { storeId: string; webhookSecret: string; baseUrl: string } | null = null;
|
||||
|
||||
export function getLemonSqueezyConfig() {
|
||||
if (_config) return _config;
|
||||
|
||||
const storeId = process.env.LEMONSQUEEZY_STORE_ID;
|
||||
const webhookSecret = process.env.LEMONSQUEEZY_WEBHOOK_SECRET;
|
||||
const baseUrl = process.env.NEXT_PUBLIC_APP_URL;
|
||||
|
||||
if (!storeId) {
|
||||
throw new Error('LEMONSQUEEZY_STORE_ID is required');
|
||||
}
|
||||
|
||||
if (!webhookSecret) {
|
||||
throw new Error('LEMONSQUEEZY_WEBHOOK_SECRET is required');
|
||||
}
|
||||
|
||||
if (!baseUrl) {
|
||||
throw new Error('NEXT_PUBLIC_APP_URL is required');
|
||||
}
|
||||
|
||||
_config = { storeId, webhookSecret, baseUrl };
|
||||
return _config;
|
||||
}
|
||||
Reference in New Issue
Block a user