@adsim/site-manager-connector
v0.1.0
Published
Connect any React/Vite site to the AdSim Site Manager MCP — auto-migration, SEO components, Content Contract discovery
Maintainers
Readme
@adsim/site-manager-connector
Connectez n'importe quel site React/Vite au Site Manager MCP d'AdSim — SEO, maillage interne, contenu dynamique, le tout piloté par IA.
Quick Start
npm install @adsim/site-manager-connector# Migration des tables sm_* dans Supabase
SUPABASE_URL=https://xxx.supabase.co SUPABASE_KEY=eyJ... SITE_ID=mon-site npx sm-connector migrate// main.tsx
import { SiteManagerConnector } from '@adsim/site-manager-connector';
await SiteManagerConnector.init({
supabaseUrl: import.meta.env.VITE_SUPABASE_URL,
supabaseKey: import.meta.env.VITE_SUPABASE_ANON_KEY,
siteId: 'mon-site',
});// ProductPage.tsx
import { SeoHead, SchemaInjector, RelatedLinks } from '@adsim/site-manager-connector/react';
function ProductPage({ product }) {
return (
<>
<SeoHead pageType="products" pageId={product.id} fallbackTitle={product.name} />
<SchemaInjector pageType="products" pageId={product.id} />
<RelatedLinks sourceType="products" sourceId={product.id} buildUrl={(l) => `/products/${l.target_id}`} />
</>
);
}Tables sm_* (migration additive)
| Table | Rôle |
|-------|------|
| sm_seo_meta | Meta SEO par page et par locale |
| sm_internal_links | Maillage interne avec scoring et approbation |
| sm_schema_org | JSON-LD (Product, Article, FAQ...) |
| sm_audit_log | Historique des actions MCP |
| sm_seo_history | Snapshots des scores SEO |
| sm_globals | Config site + Content Contract |
| sm_navigation | Menus dynamiques |
| sm_analytics_cache | Cache GA4/GSC |
Composants React
| Composant | Rôle |
|-----------|------|
| <SeoHead /> | Injecte meta tags depuis sm_seo_meta |
| <SchemaInjector /> | Injecte JSON-LD depuis sm_schema_org |
| <RelatedLinks /> | Affiche maillage interne approuvé |
| <DynamicContent /> | Contenu éditable via MCP |
Hooks
| Hook | Retour |
|------|--------|
| useSmSeo({ pageType, pageId, locale }) | { seo, loading, error } |
| useSmSchema({ pageType, pageId }) | { schemas, loading } |
| useSmLinks({ sourceType, sourceId }) | { links, loading } |
| useSmGlobal({ key, field }) | { value, loading } |
CLI
| Commande | Description |
|----------|-------------|
| npx sm-connector migrate | Crée les 8 tables sm_* |
| npx sm-connector discover | Génère le Content Contract |
| npx sm-connector status | Vérifie les tables |
| npx sm-connector sql | Affiche le SQL brut |
License
MIT — AdSim SRL
