# SDK Reference

The Allegro SDK is a browser JavaScript library that loads via a `<script>` tag and exposes its API on `window.allegro`. It handles event tracking, member authentication, and on-page interactions.

## Quick Example[​](#quick-example "Direct link to Quick Example")

```html
<script>
    window.allegro = window.allegro || [];

    window.allegro.push(function (allegro) {
        // Track an event
        allegro.track('article_read', {
            content_id: '123',
            content_type: 'article',
        });

        // Check if the current visitor is authenticated
        if (allegro.member.isAuthenticated()) {
            const payload = allegro.member.sessionFromJwt();
            console.log('Hello,', payload.audience_member.name);
        }
    });
</script>

<script src="https://your-allegro-instance.com/client.js"></script>

```

`window.allegro.push()` queues callbacks that run as soon as the SDK is ready. If the SDK has already loaded by the time `push()` is called, the callback runs immediately.

## Namespaces[​](#namespaces "Direct link to Namespaces")

| Namespace                                                                            | Description                                               |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| [`allegro.track()`](/developer/api-reference/interfaces/AllegroSDK.md)               | Track named events with automatic page context collection |
| [`allegro.member`](/developer/api-reference/interfaces/MemberNamespace.md)           | Authenticate and identify audience members                |
| [`allegro.interaction`](/developer/api-reference/interfaces/InteractionNamespace.md) | Trigger and manage on-page interactions                   |
