Configuration
app.config.ts and runtimeConfig reference for @xenterprises/nuxt-x-affiliate.
Configuration
app.config.ts
export default defineAppConfig({
xAffiliate: {
referralParam: 'ref',
referralBaseUrl: 'https://yoursite.com',
cookieName: 'x_affiliate_ref',
cookieDays: 30,
currency: 'USD',
shareMessage: 'Check this out!',
landing: {
hero: {
title: '',
description: '',
ctaLabel: '',
highlightText: '',
variant: 'gradient', // 'gradient' | 'primary' | 'dark'
},
benefits: [],
},
signup: {
title: 'Join Our Affiliate Program',
subtitle: 'Earn commissions...',
submitLabel: 'Apply Now',
showWebsite: true,
showCompany: false,
showMessage: true,
},
},
})
Schema Reference
| Key | Type | Default | Description |
|---|---|---|---|
referralParam | string | 'ref' | URL query parameter name used to detect referral codes. |
referralBaseUrl | string | '' | Base URL prepended when generating referral links. |
cookieName | string | 'x_affiliate_ref' | Cookie name used to persist the referral code. |
cookieDays | number | 30 | Referral cookie expiration in days. |
currency | string | 'USD' | Default ISO 4217 currency code for earnings formatting. |
shareMessage | string | 'Check this out!' | Default message pre-filled in social share dialogs. |
landing.hero.title | string | '' | Landing page hero headline. |
landing.hero.description | string | '' | Landing page hero subtitle. |
landing.hero.ctaLabel | string | '' | Landing page hero CTA button label. |
landing.hero.highlightText | string | '' | Highlight badge text shown in the hero. |
landing.hero.variant | 'gradient' | 'primary' | 'dark' | 'gradient' | Visual style of the XAFBanner hero. |
landing.benefits | { icon, title, description }[] | 3 defaults | Benefits cards shown on the landing page. |
signup.title | string | 'Join Our Affiliate Program' | Signup form title. |
signup.subtitle | string | 'Earn commissions...' | Signup form subtitle. |
signup.submitLabel | string | 'Apply Now' | Signup form submit button label. |
signup.showWebsite | boolean | true | Show website URL field in signup form. |
signup.showCompany | boolean | false | Show company name field in signup form. |
signup.showMessage | boolean | true | Show promotion strategy textarea in signup form. |
Runtime Config / Environment Variables
None required. All configuration is through app.config.ts.
AI Context
package: "@xenterprises/nuxt-x-affiliate"
config-key: xAffiliate
useReferralTracking
Detects referral codes from URL query parameters, persists them to a cookie, and exposes helpers to read, check, and clear the tracked referral.
xlayer-ui
Base UI layer for Nuxt — shared fonts (Mona Sans, Hubot Sans), 60+ CSS design tokens, utility classes, and a useXUI() composable consumed by all xlayers.
