# Blade

Learn how to run a snippet once the client-side SDK is ready.

The `@croct` Blade directive defers a snippet until the client-side SDK has loaded, then runs it with the [`croct`](/reference/sdk/javascript/api/plug) instance available, regardless of the loading [mode](/reference/sdk/laravel/api/configuration#script-prop).

## Signature

Wrap a block of JavaScript between the @croct and @endcroct directives:

```blade
@croct
    // your JavaScript using the croct instance
@endcroct
```

To set a Content Security Policy nonce on the generated script tag, pass it as an argument:

```blade
@croct($nonce)
    // your JavaScript using the croct instance
@endcroct
```

## Example

Here is a basic example of how to use this directive, passing server-side values into the snippet with Blade:

**resources/views/checkout/confirmation.blade.php**

```blade
@croct
    croct.track('orderPlaced', {
        order: {
            orderId: @json($order->id),
            total: @json($order->total),
        },
    });
@endcroct
```

## Parameters

The following list describes the supported parameters:

- `nonce`: `string` (optional) (default: null)

  A [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) nonce added to the generated script tag.
