Composant Web d'onboarding Scell.io
Intégrez un flux complet de vérification d'entreprise et d'onboarding à la facturation électronique en une seule ligne de code. Validation SIREN, vérification TVA et confirmation du représentant légal incluses.
<script src="https://cdn.scell.io/widget/v1/onboarding.js"></script>
<scell-onboarding
publishable-key="pk_test_xxxx"
environment="sandbox"
></scell-onboarding>Démarrage rapide
pk_test_* (obtenue dans votre dashboard) pour tester le composant en mode sandbox. Les données de test ne sont pas persistées.Le composant d'onboarding Scell.io gère l'intégralité du flux de vérification d'entreprise : recherche SIREN/SIRET, validation du numéro de TVA, vérification d'adresse et confirmation du représentant légal.
Étape 1 : Inclure le script
<script src="https://cdn.scell.io/widget/v1/onboarding.js"></script>Étape 2 : Ajouter le composant
<scell-onboarding
api-key="pk_live_your_api_key"
environment="production"
theme="auto"
locale="fr"
></scell-onboarding>Étape 3 : Gérer les événements
document.querySelector('scell-onboarding')
.addEventListener('onboarding:completed', (e) => {
console.log('Company verified:', e.detail.company_id);
// Redirect to dashboard or update UI
});Démo interactive
Cette démo utilise une clé publishable de test. Créez votre compte pour obtenir votre propre clé pk_test_* et tester le widget avec vos données.
Testez le composant Scell.io Onboarding directement ci-dessous. Ce widget permet à vos utilisateurs de vérifier leur entreprise (SIREN, TVA, représentant légal) et de compléter leur inscription.
Ce widget fonctionne en mode sandbox. Pour l'intégrer, consultez le guide Quick Start ci-dessus.
Référence API
Attributs
Configurez le comportement du composant via des attributs HTML.
| Attribut | Type | Requis | Description |
|---|---|---|---|
publishable-key | string | Oui | Votre clé publishable (pk_live_xxx ou pk_test_xxx) |
environment | "sandbox" | "production" | Non | Environnement. Par défaut : "sandbox" |
external-id | string | Non | Votre identifiant interne pour ce sub-tenant (lien avec votre système) |
callback-url | string | Non | URL de redirection après complétion de l'onboarding |
theme | "light" | "dark" | "auto" | Non | Thème de couleur. Par défaut : "light" |
locale | "fr" | "en" | Non | Langue du widget. Par défaut : "fr" |
width | string | Non | Largeur du widget. Par défaut : "100%" |
height | string | Non | Hauteur du widget. Par défaut : "600px" |
Événements
Écoutez les événements du composant pour réagir aux actions de l'utilisateur et aux changements d'état.
| Événement | Payload | Description |
|---|---|---|
onboarding:started | { sessionId: string } | La session d'onboarding a été initialisée |
onboarding:step | { step: string, progress: number } | L'utilisateur a changé d'étape (siret, verify, documents, complete) |
onboarding:siret-verified | { companyName: string, siret: string } | Le SIRET a été vérifié avec succès |
onboarding:documents-uploaded | { count: number } | Des documents KYB ont été uploadés |
onboarding:completed | { authorizationCode: string, externalId?: string } | L'onboarding est terminé — échangez le code via POST /onboarding/exchange |
onboarding:error | { code: string, message: string } | Une erreur s'est produite pendant l'onboarding |
Modes d'intégration
Choisissez la méthode d'intégration qui correspond le mieux à votre architecture.
Web Component
Intégrez directement dans votre frontend. Idéal pour les SPAs et les applications web modernes.
- Intégration la plus rapide
- Personnalisation complète
- Événements en temps réel
- Fonctionne partout
Redirect Flow
Redirigez les utilisateurs vers la page hébergée Scell.io. Idéal pour les applications server-rendered.
- Aucun code frontend
- Hébergé par Scell.io
- Flux OAuth-like
- Conforme PCI
API Only
Construisez votre propre UI. Contrôle total sur le flux de vérification.
- Contrôle complet
- UX personnalisée
- Backend-first
- White label
Exemple API REST
// Create onboarding session via APIconst response = await fetch('https://api.scell.io/api/v1/onboarding/sessions', { method: 'POST', headers: { 'X-API-Key': 'sk_live_xxxx', 'Content-Type': 'application/json' }, body: JSON.stringify({ company_id: 'comp_xxxx', redirect_url: 'https://yourapp.com/callback', webhook_url: 'https://yourapp.com/webhooks/scell', metadata: { user_id: 'user_123', plan: 'enterprise' } })});const { session_id, session_url, expires_at } = await response.json();// Redirect user to session_url or embed Web Component with session_idExemple Redirect Flow
// 1. Create session on your backendconst session = await scellApi.createOnboardingSession({ company_id: companyId, redirect_url: 'https://yourapp.com/onboarding/callback', success_url: 'https://yourapp.com/dashboard?verified=true', cancel_url: 'https://yourapp.com/dashboard?verified=false'});// 2. Redirect user to Scell.io hosted pagewindow.location.href = session.session_url;// 3. Handle callback on your redirect URL// Query params: ?session_id=xxx&status=completed&signature=xxxExemples par framework
Exemples prêts à copier pour les frameworks populaires.
import { useEffect, useRef } from 'react';// Declare the custom element typedeclare global { namespace JSX { interface IntrinsicElements { 'scell-onboarding': React.DetailedHTMLProps< React.HTMLAttributes<HTMLElement> & { 'api-key'?: string; 'mode'?: 'sandbox' | 'production'; 'company-id'?: string; 'redirect-url'?: string; 'theme'?: 'light' | 'dark' | 'auto'; 'locale'?: string; }, HTMLElement >; } }}export function ScellOnboarding({ apiKey, companyId, onComplete, onError }) { const ref = useRef<HTMLElement>(null); useEffect(() => { // Load the Web Component script const script = document.createElement('script'); script.src = 'https://cdn.scell.io/widget/v1/onboarding.js'; script.async = true; document.head.appendChild(script); return () => { document.head.removeChild(script); }; }, []); useEffect(() => { const el = ref.current; if (!el) return; const handleComplete = (e: CustomEvent) => onComplete?.(e.detail); const handleError = (e: CustomEvent) => onError?.(e.detail); el.addEventListener('onboarding:completed', handleComplete); el.addEventListener('onboarding:error', handleError); return () => { el.removeEventListener('onboarding:completed', handleComplete); el.removeEventListener('onboarding:error', handleError); }; }, [onComplete, onError]); return ( <scell-onboarding ref={ref} api-key={apiKey} company-id={companyId} environment="production" theme="auto" /> );}Webhooks
Recevez des notifications en temps réel lorsque des événements d'onboarding se produisent. Configurez votre URL webhook depuis le tableau de bord.
x-scell-signature.Exemple de payload webhook
// Example webhook payload for onboarding.completed{ "event": "onboarding.completed", "created_at": "2024-01-15T10:30:00Z", "data": { "session_id": "sess_xxxx", "company_id": "comp_xxxx", "status": "verified", "verification": { "siren_verified": true, "vat_verified": true, "address_verified": true, "legal_rep_verified": true }, "company": { "name": "ACME Corporation", "siren": "123456789", "vat_number": "FR12345678901", "address": { "street": "123 Rue de Paris", "city": "Paris", "postal_code": "75001", "country": "FR" } } }, "signature": "sha256=xxxxx"}Événements webhook disponibles
| Événement | Description |
|---|---|
onboarding.started | L'utilisateur a démarré le flux d'onboarding |
onboarding.step_completed | L'utilisateur a complété une étape de vérification |
onboarding.completed | Toutes les étapes de vérification ont été complétées avec succès |
onboarding.failed | La vérification a échoué (données invalides, timeout, etc.) |
onboarding.cancelled | L'utilisateur a annulé l'onboarding |
Prêt à intégrer ?
Créez votre compte et obtenez vos clés API en quelques minutes. Démarrez avec 100 crédits gratuits.