Skip to content

setkaio/setka_integration

Repository files navigation

Setka Integration REST API wrapper

Wraps the Setka Integration API for access from ruby applications.

Documentation for the Setka Editor API: https://setka.gitbook.io/help-center/api/setka-editor-api/integration-with-style-manager.

Installation

Add this line to your application's Gemfile:

gem 'setka_integration', '~> 0.2.0', git: 'https://github.com/setkaio/setka_integration'

And then execute:

$ bundle

Or install it yourself as:

$ gem install setka_integration

Usage

Configuration

First, put in your initializers next script:

SetkaIntegration.configure(
  license_key: 'your_license_key'
)

You can find instructions about license keys in the Before you start section of Setka Editor API documentation.

Initial sync

To get style and editor files, you have to run

SetkaIntegration::Init.files

You can find the description of the received files in the following API request documentation section. You will receive only files URLs without additional info like id and filetype.

Additional files

To make an API request for the additional files:

SetkaIntegration::Options.files('amp,fonts,icons')

You can customize arguments like 'amp,icons', 'fonts' and other combinations. You can find the description of the received files in the following API request documentation section.

Specific files

To get the needed array of files:

SetkaIntegration::Select.files('plugins,editor,theme,standalone,amp,fonts,icons')

You can customize arguments. You can find the description of the received files in the following API request documentation section.

Also, you have request to receive files for full options list:

SetkaIntegration::Select.all

And, if you want, there are example requests you have to get single kind of files:

SetkaIntegration::Select.public_token
SetkaIntegration::Select.plugins
SetkaIntegration::Select.editor_files.css
SetkaIntegration::Select.theme_files.json
SetkaIntegration::Select.standalone_styles.themes_critical
SetkaIntegration::Select.amp_styles.common
SetkaIntegration::Select.fonts
SetkaIntegration::Select.icons