Saber Feedback Documentation

Run-time Options

With Saber’s run-time options, you can specify options for the feedback button and interface at run-time. This allows you to easily have different options for different pages, or depending on Javascript conditions.

Note: Run-time options will always take priority over the options you specify in the website settings section of the control panel.

Run-time options are set using the Saber.do('set_option', 'option_name', 'option_value'); and Saber.do('set_options', { option_name_1: 'option_value_1', option_name_2: 'option_value_2'}); methods of Saber’s Javascript API.


language string

Default: 'en'

This specifies the language in which the user interface should be displayed, the value must be a 2 character language code, and can be any of the following:
  • en – English (default)
  • cz – Czech
  • de – German
  • dk – Danish
  • es – Spanish
  • fr – French
  • hu – Hungarian
  • it – Italian
  • nl – Dutch
  • pt – Portuguese
  • ru – Russian
  • se – Swedish
  • tr – Turkish

Example:

Saber.do('set_option', 'language', 'fr');

position string

Default: 'right'

Can be either 'left' or 'right'. Set this to 'left' if you would like the feedback button to display on the left hand side of the screen.

Example:

Saber.do('set_option', 'position', 'left');

style string

Default: 'label'

Can be either 'label' or 'tab'. Set this to 'tab' if you would like the feedback button to be displayed horizontally on the bottom of the screen, instead of vertically at the side of the screen.

Example:

Saber.do('set_option', 'style', 'tab');

label_text string

Default: 'Feedback'

Modify this to change the label text on the feedback button. If you do not define this, the default of 'Feedback' will be used, and will be translated to the appropriate language if you set the language to anything but English.

Example:

Saber.do('set_option', 'label_text', 'Report an Issue');

feedback_values hash

Default: null

The feedback_values hash can be used to specify default values for you feedback fields, as well as Custom Data.

The hash is in the format { field_api_name: field_value }. The field's API name can be found in the Form Builder section of the Saber control panel. Default field API names always start with an underscore.

Default feedback categories also have underscore prefixed API names which can be found in control panel when setting up your category field. This is so that the category names can be translated into other language.

Example:

Saber.do('set_option', 'feedback_values', {
    Email: 'matt@saberfeedback.com',
    Category: '_problem',
    user_id: 69,
  }
);

background_color string

Default: '#222222'

Controls the background color of the Feedback button. This can be any valid Hexadecimal RGB Color.

Example:

Saber.do('set_option', 'background_color', '#0064cd');

text_color string

Default: '#ffffff'

Controls the text color of the Feedback button, as well as the inner border color. This can be any valid Hexadecimal RGB Color.

Example:

Saber.do('set_option', 'text_color', '#0000000');

show_thanks boolean

Default: true

Set this to false to simply exit Saber as soon as feedback is sent, instead of showing the "Thanks for the Feedback!" message.

Example:

Saber.do('set_option', 'show_thanks', false);

hide_button boolean

Default: false

If you set this to true, Saber will load normally, but the feedback button will not be shown. Instead you will be able to trigger Saber to open using the JavaScript API's open method.

Example:

Saber.do('set_option', 'hide_button', true);

disable_event_log boolean

Default: false

If you set this to true, Saber will not log events, such as page loads, AJAX requests and Javascript errors.

Example:

Saber.do('set_option', 'disable_event_log', true);

event_log_max_length integer

Default: 100

To avoid filling your browsers memory, Saber only stores the most recent 100 events. You can change this to any other number, if you'd like more or less event history to be stored.

Example:

Saber.do('set_option', 'event_log_max_length', 420);

cookies hash

Beta - This feature is currently in beta, and may not always work. Please get in touch if you find any issues with it.

Default: null

Use this to set cookies on Saber's screenshot server. Eg: if your site's CSS or images require authentication, you can specify an authenticated cookie value so that the Saber screenshot server can access them.

The cookies hash should be in the format of URL: { cookie_name: cookie_value }. Multiple URLs can be specified, and each URL can have multiple cookies (see the example below).

The URL is required as the screenshot server first needs to navigate to this URL in order to set the cookie. It's best to choose a fast loading page to keep screenshot creation as quick as possible.

Please note: The URLs must be for HTML documents, as some browsers will not allow cookies to be set on images or any other non-HTML URLs.

Example:

Saber.do('set_option', 'cookies', {
    'http://yoursite.com': {
       cookiename:'cookievalue',
       cookie_two:'something'
    },
    'http://google.com': {
      more:'cookies'
    }
  }
);

suppress_localhost_warning boolean

Default: false

Set this to true to hide the localhost warning message that is displayed when running Saber on a local environment.

Example:

Saber.do('set_option', 'suppress_localhost_warning', true);