> ## Documentation Index
> Fetch the complete documentation index at: https://storekit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Testare i webhook

> Testa la tua integrazione webhook prima di andare live. Invia eventi di esempio dalla dashboard, riesegui le consegne e sviluppa localmente usando ngrok o tunnel simili.

Testare la tua integrazione webhook prima di andare live è essenziale per un'integrazione senza intoppi.

## Utilizzare la dashboard

### Inviare eventi di test

1. Vai al tuo endpoint webhook nella dashboard
2. Clicca **Send Test Event**
3. Seleziona il tipo di evento da testare
4. Rivedi il payload di test e invialo

### Visualizzare i log dei webhook

La dashboard mostra un log completo di tutte le consegne dei webhook:

* **Stato**: Successo o fallimento
* **Tempo di risposta**: Quanto tempo ha impiegato il tuo endpoint a rispondere
* **Codice di risposta**: Il codice di stato HTTP restituito
* **Payload**: I dati esatti inviati

## Sviluppo locale

Durante lo sviluppo, il tuo localhost non è accessibile da Internet. Ecco alcune soluzioni:

### Usare ngrok

[ngrok](https://ngrok.com) crea un URL pubblico che fa da tunnel al tuo server locale:

```bash theme={null}
# Start your local server on port 3000
npm run dev

# In another terminal, start ngrok
ngrok http 3000
```

Usa l'URL di ngrok (ad es. `https://abc123.ngrok.io/webhooks`) come endpoint webhook.

### Usare webhook.site

[webhook.site](https://webhook.site) fornisce un URL gratuito che cattura tutte le richieste in arrivo:

1. Vai su webhook.site
2. Copia il tuo URL univoco
3. Aggiungilo come endpoint webhook in storekit
4. Attiva eventi e ispeziona i payload

## Checklist di test

Prima di andare live, verifica:

<Checklist>
  * [ ] L'endpoint restituisce lo stato 2xx entro 15 secondi
  * [ ] La verifica della firma è implementata
  * [ ] La validazione del timestamp rifiuta i webhook obsoleti
  * [ ] L'handler è idempotente (gestisce i duplicati)
  * [ ] Gli errori vengono registrati per il debug
  * [ ] La protezione CSRF è disabilitata per l'endpoint
</Checklist>

## Modalità test vs modalità live

Testa i webhook nel tuo ambiente di sviluppo prima di abilitarli in produzione:

1. Crea un endpoint separato per i test
2. Usa credenziali di test/sandbox
3. Verifica che tutto funzioni
4. Passa all'endpoint di produzione


## Related topics

- [Configurazione dei webhook](/docs/it/developers/webhooks/setting-up-webhooks.md)
- [Trasformazioni](/docs/it/developers/webhooks/transformations.md)
- [Impostazioni operative: tempo di preparazione, accettazione automatica e upsell](/docs/it/guides/store-settings/operations-settings.md)
- [Store connesso al POS](/docs/it/getting-started/store-types/pos-connected-store.md)
- [Eventi webhook](/docs/it/developers/webhooks/webhook-events.md)
