mirror of
https://github.com/luxfi/brand-types.git
synced 2026-10-30 17:01:13 +00:00
Adds two new exported types for the federation descriptor split documented in LP-0010 §4.1: - WellKnownBrand — pure identity, served at /.well-known/brand.json, owned by the brand team, cacheable 24h+ - WellKnownApp — federation graph (peers, capabilities, chain binding, API root) served at /.well-known/<appId>.json, references the brand via a URL with optional sha256 integrity tag The legacy mashed shape continues to work; new consumers fetch the app descriptor and follow its brand link. Bumps package version to 0.2.0 (additive — no breaking changes to the existing BrandConfig/AppDescriptor/MergedBrand exports).
1.7 KiB
1.7 KiB
@luxfi/brand-types
Neutral TypeScript types for white-label brand identity, application descriptors, and federation discovery.
What's inside
BrandConfig,BrandTheme— runtime brand identity (name, domains, social, theme overlay)AppKind,AppDescriptor— describes one application surface (market / exchange / explorer / etc.)FederationPeer,ChainBinding,MergedBrand— federation discovery glueWellKnownBrand— payload at/.well-known/brand.json(identity only, owned by brand team)WellKnownApp— payload at/.well-known/<appId>.json(federation graph, references the brand by URL)
What it is not
- Not a runtime: importing this at runtime is an empty module (types are erased).
- Not opinionated about transport: how you fetch
brand.jsonor/.well-known/<app>.jsonis up to you. - Not branded: this package contains zero literal brand names. Consumers supply the values.
Install
pnpm add -D @luxfi/brand-types # or: bun add -D, npm i -D
Use
import type { BrandConfig, MergedBrand, AppKind } from '@luxfi/brand-types'
const brand: BrandConfig = {
name: 'Example',
title: 'Example — App',
description: 'An example deployment.',
shortName: 'EX',
appDomain: 'app.example.test',
}
To add app-specific fields, extend locally:
import type { BrandConfig as CanonicalBrandConfig } from '@luxfi/brand-types'
export interface BrandConfig extends CanonicalBrandConfig {
walletConnectProjectId?: string
insightsHost?: string
}
Specs
Implements the schema referenced by:
- LP-0010 — Lux Brand Discovery
- HIP-0303 — Hanzo Brand Discovery
- ZIP-0031 — Zoo Brand Discovery
License
BSD-3-Clause. See LICENSE.