# Conviva Options

Conviva requires certain information to be configured:

- Metadata - Conviva specific
- Tags - Client specific

## Metadata

Data that Conviva requires. Certain metadata must be set via:

- Init Config
- Play Options

### Init Config

Conviva metadata is set on the plugin config metadata.

#### Options

Name | Type | Description | Required
--- | --- | --- | ---
customerKey | `String` | Unique identifier | Y
applicationName | `String` | Name of the application | Y
touchstoneUrl | `String` | Url to Conviva's testing tool Touchstone | N

#### Snippet

    var player = TOP.createAndInitPlayer({
        config : {
            plugins : [
                {
                    kind : 'top.plugins.conviva',
                    metadata : {
                        customerKey    : '<your customer key>',
                        applicationName: '<your app name>',
                        touchstoneUrl  : '<your touchstone url>' // optional
                    }
                }
            ]
        }
    });

### Play Options

Other information will be set on `convivaMetadata` in the play options (stream url, isLive, and duration will automatically be populated by `TOP`):

#### Required

Name | Type | Description
--- | --- | ---
assetName | `String` | Unique name for each stream/video asset.
viewerId | `String` | A unique identifier to distinguish individual viewers or devices through Conviva's Viewers Module (purchase required). The identifier may be a user's unique username, an email address, a unique device identifier, or a generated GUID.

#### Optional

Name | Type | Description
--- | --- | ---
defaultResource | `String` | Used as the resource name for integrations where the streamer does not know the resource being played.

### Snippet

    var options = {
        convivaMetadata : {
            assetName       : '<your asset name>',
            viewerId        : '<your viewer id>'
        }
    };

    player.play(
        '//content.m3u8',
        options
    );

## Tags

Optional client specific information will be set on `convivaTags` in the play options.

### Snippet

    var options = {
        convivaTags : {
            prop1 : 'whatever',
            prop2 : 'you want',
            prop3 : 'can go here'
        }
    };

    player.play(
        '//content.m3u8',
        options
    );