Skip to main content

Common Features (Profile Data)

The common-features system shares profile data — contact, developer, social, address, payment, services, skills, testimonials, and projects — across every app so the same facts stay consistent everywhere. Edit once in the admin panel; every app reads the same values.

Why this exists

Your footer's email, your "follow me" links, your payment options, and your testimonials are the same in every app. Hard-coding them means ten places to update when one changes. Common features makes them a single shared source.

Hooks

Each data type has a typed hook. Single-record hooks return UseCommonFeatureResult<T> ({ data, loading, error, refetch }); list hooks return UseCommonFeaturesListResult<T> ({ data: T[], loading, error, refetch }).

HookReturnsShape
useContactInfo(options?)Contact infosingle
useDeveloperInfo(options?)Developer infosingle
useAddressInfo(options?)Address infosingle
useSocialLinks(options?)Social linkslist
usePaymentOptions(options?)Payment optionslist
useServices(options?)Serviceslist
useSkills(options?)Skillslist
useTestimonials(options?)Testimonialslist
useProjects(options?)Projectslist
useProject(slug, options?)One project by slugsingle
import { useContactInfo, useSocialLinks } from 'shared-features';

function Footer() {
const { data: contact, loading } = useContactInfo();
const { data: socials } = useSocialLinks({ showIn: 'footer', activeOnly: true });

if (loading || !contact) return null;

return (
<footer>
<a href={`mailto:${contact.email}`}>{contact.email}</a>
<nav>
{socials.map((s) => (
<a key={s.id} href={s.url}>{s.platform}</a>
))}
</nav>
</footer>
);
}

Common options

  • autoFetch (default true) — fetch on mount.
  • realtime (default false) — subscribe to live updates for the single-record hooks (useContactInfo, useDeveloperInfo).
  • List hooks add filters such as showIn, activeOnly (and per-type options like FetchSkillsOptions, FetchTestimonialsOptions, …).

Ready-made components

If you do not want to build the UI yourself, the package exports themed cards:

ComponentRenders
ContactCardContact details
DeveloperCardDeveloper bio/links
SocialLinksBarA row of social links
AddressCardAddress block
SkillsDisplaySkills list/grid
TestimonialsGridTestimonials grid
ServicesGridServices grid
FooterSectionA composed footer using the above
import { FooterSection } from 'shared-features';

<FooterSection />

Caching

Each data type is cached after the first fetch. Clear helpers are exported per type (clearContactInfoCache, clearSocialLinksCache, …) plus clearAllCommonFeaturesCache() to reset everything.

FAQ

Are these features always available? Availability is gated by the feature flags (contactInfo, socialLinks, …). Combine useFeature('contactInfo') with useContactInfo() if you want to fall back to legacy local data when the admin has not enabled the shared version.

Can I write this data from my app? The read hooks are for consuming apps. Write operations (saveContactInfo, createSocialLink, …) exist in the admin services layer and are intended for the admin panel, not normal apps.

See the services reference for the full read/write API and the types reference for the data shapes.