X Enterprises

Configuration

app.config.ts reference for @xenterprises/nuxt-x-affiliate — covers xAffiliate (dashboard + brand + author + legal + tracking) and xAffiliateContent (merchants + currency).

Configuration

The layer exposes two config namespaces in app.config.tsxAffiliate (five areas) and xAffiliateContent:

  1. xAffiliate.legal — canonical legal pages + opt-in disclosures
  2. xAffiliate.author — site author identity (E-E-A-T)
  3. xAffiliate.brand — site brand identity (OG, Twitter, Organization schema)
  4. xAffiliate.tracking — GTM / GA4 / Clarity IDs
  5. xAffiliate.referral* / landing.* / signup.* — dashboard-family config
  6. xAffiliateContent — merchant tagging + currency
Your app.config.tsmust live in the consuming project's app/ directory (app/app.config.ts). Nuxt 4's default srcDir is app/ — a root-level app.config.ts silently yields a merged config with only Nuxt UI defaults and none of your overrides.

Full example

export default defineAppConfig({
  xAffiliate: {
    // 1) Legal — central canonical pages + opt-in disclosures
    legal: {
      baseUrl: 'https://x.enterprises/legal',
      optIn: {
        health: false,           // → enables <XAFHealthDisclaimer>
        aiContent: true,         // → enables <XAFAIContentDisclosure>
        sponsoredContent: false, // → enables <XAFSponsoredContentDisclosure>
      },
    },

    // 2) Author — site-wide identity (E-E-A-T signal)
    author: {
      name: 'Jane Reviewer',
      role: 'Senior Kitchen Gear Editor',
      bio: '8 years reviewing kitchen equipment for home cooks.',
      image: '/team/jane.jpg',
      credentials: ['CNC-certified', '8 years testing kitchen gear'],
      social: {
        twitter: 'https://twitter.com/jane',
        linkedin: 'https://linkedin.com/in/jane',
        website: 'https://janereviews.com',
      },
    },

    // 3) Brand — drives Organization schema + meta tags
    brand: {
      name: 'BestKitchenGear.com',
      tagline: 'We test so you don\'t have to.',
      logo: 'https://bestkitchengear.com/logo.png',
      url: 'https://bestkitchengear.com',
      ogImage: 'https://bestkitchengear.com/og.png',
      twitter: 'bestkitchengear',
      ogType: 'website',
      locale: 'en_US',
    },

    // 4) Tracking — GTM / GA4 / Clarity auto-injection
    tracking: {
      gtmId: 'GTM-XXXXXXX',
      ga4Id: 'G-XXXXXXXX',
      clarityId: 'abc123def4',
      autoInject: true,
    },

    // 5) Referral / dashboard family
    referralParam: 'ref',
    referralBaseUrl: 'https://yoursite.com',
    cookieName: 'x_affiliate_ref',
    cookieDays: 30,
    currency: 'USD',
    shareMessage: 'Check this out!',
    landing: { /* ... */ },
    signup: { /* ... */ },
  },

  xAffiliateContent: {
    currency: 'USD',
    locale: 'en-US',
    disclosure: {
      text: 'Affiliate link. We may earn a commission at no cost to you.',
      position: 'above',
    },
    merchants: {
      amazon:  { tagValue: 'yourtag-20' },
      walmart: { tagValue: 'TODO' },
    },
  },
})

1) xAffiliate.legal

KeyTypeDefaultDescription
baseUrlstring'https://x.enterprises/legal'Canonical URL where the site's legal pages live. Every consuming site points at the central home — no per-site legal pages to maintain.
optIn.healthbooleanfalseWhen true, sites covering health/medical topics should render <XAFHealthDisclaimer> on relevant pages.
optIn.aiContentbooleanfalseWhen true, render <XAFAIContentDisclosure> per FTC 2024+ guidance on AI-assisted content.
optIn.sponsoredContentbooleanfalseWhen true, render <XAFSponsoredContentDisclosure> on paid-placement posts.
pages.affiliateDisclosurestring{baseUrl}/affiliate-disclosureOverride the canonical disclosure URL.
pages.privacystring{baseUrl}/privacy-policyOverride the privacy policy URL.
pages.termsstring{baseUrl}/termsOverride the terms URL.
pages.cookiesstring{baseUrl}/cookie-policyOverride the cookie policy URL.
pages.earningsstring{baseUrl}/earnings-disclaimerOverride the earnings disclaimer URL.
pages.aiContentstring{baseUrl}/ai-contentOverride the AI content policy URL.
pages.sponsoredContentstring{baseUrl}/sponsored-contentOverride the sponsored content policy URL.
pages.healthstring{baseUrl}/health-disclaimerOverride the health disclaimer URL.
pages.editorialPolicystring{baseUrl}/editorial-policyOverride the editorial policy URL.
pages.contactstring{baseUrl}/contactOverride the contact page URL.

The marketing layer (@xenterprises/nuxt-x-marketing) renders the 5-link default legal nav (Affiliate Disclosure, Privacy, Terms, Cookie, Earnings) using these URLs, plus the 3-link conditional set (Health, AI Content, Sponsored Content) driven by optIn.* flags.


2) xAffiliate.author

KeyTypeRequiredDescription
namestringAuthor name. Drives <XAFAuthorBox> and Person schema.
rolestringOne-line role (e.g. "Senior Kitchen Gear Editor").
biostring1–3 sentence bio shown in the author box and Person schema description.
imagestringAvatar URL (square, 200×200+ recommended).
credentialsstring[]Trust badges shown as pills (e.g. ['CNC-certified', '8 years reviewing']).
social.twitterstringTwitter / X profile URL.
social.linkedinstringLinkedIn profile URL.
social.websitestringPersonal site URL.
social.emailstringEmail address (mailto: link in author box).

3) xAffiliate.brand

KeyTypeDefaultDescription
namestringundefinedSite name. Drives <title> template, OG site_name, and Organization schema. Every site must set this.
taglinestringundefinedOne-line tagline.
logostringLogo URL. Used in Organization schema + Open Graph.
urlstringCanonical site origin (e.g. 'https://bestkitchengear.com').
ogImagestringDefault social share image (1200×630 recommended).
twitterstringTwitter handle without @ (e.g. 'bestkitchengear').
ogType'website' | 'article' | 'product''website'Default Open Graph type. Per-page composables can override.
localestring'en_US'OG locale meta.

4) xAffiliate.tracking

Read by <XAFCookieConsent /> and useXAFConsentTracking(). Scripts only fire after the matching consent category is granted.

KeyTypeDefaultDescription
gtmIdstringGoogle Tag Manager container ID (e.g. 'GTM-XXXXXXX'). Fires the analytics category.
ga4IdstringGoogle Analytics 4 measurement ID. Skipped when gtmId is set (avoids double-counting).
clarityIdstringMicrosoft Clarity project ID. Skipped when gtmId is set.
scriptsTrackingScript[][]Arbitrary scripts (Meta Pixel, Hotjar, Segment, etc.). Each fires when its category is granted.
autoInjectbooleantrueWhen false, no scripts are injected (state still tracked).

TrackingScript:

FieldTypeDescription
idstringStable ID — used to dedupe re-injection. Required.
srcstringExternal script URL.
inlinestringInline script body.
category'necessary' | 'analytics' | 'marketing'Category gate. Default 'analytics'.
attrsRecord<string, string>Extra attributes applied to the injected <script> (e.g. { async: '' }).

See CookieConsent for the full pattern.


5) xAffiliate (dashboard family)

KeyTypeDefaultDescription
referralParamstring'ref'URL query parameter for referral codes.
referralBaseUrlstringundefinedBase URL for generated referral links.
cookieNamestring'x_affiliate_ref'Cookie name for storing referral codes.
cookieDaysnumber30Referral cookie expiration in days.
currencystring'USD'Default ISO 4217 currency code for earnings formatting.
shareMessagestring'Check this out!'Default social share message.
landing.hero.titlestring'Earn Money With Our Affiliate Program'Landing page hero headline.
landing.hero.descriptionstring'Join thousands of affiliates…'Landing page hero subtitle.
landing.hero.ctaLabelstring'Apply Now'Landing page hero CTA button label.
landing.hero.highlightTextstring'Up to 30% commission'Highlight badge text.
landing.hero.variant'gradient' | 'primary' | 'dark''gradient'Visual style of the XAFBanner hero.
landing.benefitsArray<{ icon, title, description }>3 defaultsBenefits cards shown on the landing page.
signup.titlestring'Join Our Affiliate Program'Signup form title.
signup.subtitlestring'Earn commissions...'Signup form subtitle.
signup.submitLabelstring'Apply Now'Submit button label.
signup.showWebsitebooleantrueShow website URL field.
signup.showCompanybooleanfalseShow company name field.
signup.showMessagebooleantrueShow promotion strategy textarea.

6) xAffiliateContent (review-site content family)

KeyTypeDefaultDescription
currencystring'USD'ISO 4217 currency code used by formatPrice().
localestring'en-US'Locale for Intl.NumberFormat and date formatting.
disclosure.textstringbundled defaultFTC disclosure body text.
disclosure.position'above' | 'below' | 'none''above'Default position of XAFDisclosure inside XAFBuyButton.
merchantsRecord<MerchantId, XAffiliateContentMerchant>{ amazon, walmart }Per-merchant config. Built-in merchants include amazon and walmart with sensible defaults for displayName, ctaLabel, color, and tagParam.

Per-merchant schema (XAffiliateContentMerchant)

KeyTypeDefault (built-in)Description
displayNamestringvariesHuman-readable merchant name.
ctaLabelstringvariesDefault CTA button label (e.g. "Buy on Amazon").
color'primary' | 'success' | 'neutral''primary'Button color for XAFBuyButton.
tagValuestringundefinedAffiliate tag value to append. Unset = no tagging. Sites must set their own tag per merchant — untagged outbound links silently break commission attribution.
tagParamstringvariesURL parameter name (e.g. tag for Amazon, wmlspartner for Walmart).
iconstringIconify class for the merchant icon.

Built-in merchants

IDdisplayNamectaLabeltagParam
amazonAmazonBuy on Amazontag
walmartWalmartBuy on Walmartwmlspartner

Runtime Config / Environment Variables

None required. All configuration is through app.config.ts.


AI Context

package: "@xenterprises/nuxt-x-affiliate"
config-keys:
  - xAffiliate           # site-wide: legal + author + brand + tracking + referral
  - xAffiliateContent    # review-site: merchants + currency
config-pattern: |
  Every consuming site sets xAffiliate.legal.baseUrl to the canonical
  x.enterprises/legal home (no per-site legal pages). Per-site identity
  goes under xAffiliate.author + xAffiliate.brand. Per-merchant tag
  values go under xAffiliateContent.merchants.{amazon,walmart,...}.
  Legal.optIn.{health,aiContent,sponsoredContent} flags toggle the
  corresponding XAF*Disclosure components per-site.
Copyright © 2026