Class: MetronomeSDK::Resources::V1::Dashboards

Inherits:
Object
  • Object
show all
Defined in:
lib/metronome_sdk/resources/v1/dashboards.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Dashboards

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Dashboards.

Parameters:



68
69
70
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 68

def initialize(client:)
  @client = client
end

Instance Method Details

#get_embeddable_url(customer_id: , dashboard: , bm_group_key_overrides: nil, color_overrides: nil, dashboard_options: nil, request_options: {}) ⇒ MetronomeSDK::Models::V1::DashboardGetEmbeddableURLResponse

Generate secure, embeddable dashboard URLs that allow you to seamlessly integrate Metronome’s billing visualizations directly into your application. This endpoint creates authenticated iframe-ready URLs for customer-specific dashboards, providing a white-labeled billing experience without building custom UI.

### Use this endpoint to:

  • Embed billing dashboards directly in your customer portal or admin interface

  • Provide self-service access to invoices, usage data, and credit balances

  • Build white-labeled billing experiences with minimal development effort

### Key response fields:

  • A secure, time-limited URL that can be embedded in an iframe

  • The URL includes authentication tokens and configuration parameters

  • URLs are customer-specific and respect your security settings

### Usage guidelines:

  • Dashboard types: Choose from ‘invoices`, `usage`, or `commits_and_credits`

  • Customization options:

    • ‘dashboard_options`: Configure whether you want invoices to show zero usage line items

    • ‘color_overrides`: Match your brand’s color palette

    • ‘bm_group_key_overrides`: Customize how dimensions are displayed (for the usage embeddable dashboard)

  • Iframe implementation: Embed the returned URL directly in an iframe element

  • Responsive design: Dashboards automatically adapt to container dimensions

Parameters:

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
# File 'lib/metronome_sdk/resources/v1/dashboards.rb', line 54

def get_embeddable_url(params)
  parsed, options = MetronomeSDK::V1::DashboardGetEmbeddableURLParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/dashboards/getEmbeddableUrl",
    body: parsed,
    model: MetronomeSDK::Models::V1::DashboardGetEmbeddableURLResponse,
    options: options
  )
end