Module: VistarClient

Defined in:
lib/vistar_client.rb,
lib/vistar_client/error.rb,
lib/vistar_client/client.rb,
lib/vistar_client/version.rb,
lib/vistar_client/api/base.rb,
lib/vistar_client/connection.rb,
lib/vistar_client/api/ad_serving.rb,
lib/vistar_client/api/unified_serving.rb,
lib/vistar_client/api/creative_caching.rb,
lib/vistar_client/middleware/error_handler.rb

Overview

Ruby client library for the Vistar Media API.

This gem provides a simple, object-oriented interface to interact with the Vistar Media programmatic advertising platform.

Examples:

Quick start

require 'vistar_client'

# Initialize the client
client = VistarClient::Client.new(
  api_key: ENV['VISTAR_API_KEY'],
  network_id: ENV['VISTAR_NETWORK_ID']
)

# Request an ad
ad = client.request_ad(
  device_id: 'device-123',
  display_area: { width: 1920, height: 1080 },
  latitude: 37.7749,
  longitude: -122.4194,
  duration_ms: 15_000
)

# Submit proof of play
client.submit_proof_of_play(
  advertisement_id: ad['id'],
  display_time: Time.now,
  duration_ms: 15_000
)

See Also:

Defined Under Namespace

Modules: API, Middleware Classes: APIError, AuthenticationError, Client, Connection, ConnectionError, Error

Constant Summary collapse

VERSION =

Current version of the VistarClient gem

Returns:

  • (String)

    the semantic version number

'0.3.0'