Ruby
Get started with Orshot Ruby SDK
Installation
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
Initialise a client
Render from a template
Generate a Signed URL
Example
base64
response format
binary
response format
Data is written to the file og.png
url
response format
Signed URL
render_from_template
Use this function to render an image/pdf. This method accepts a hash with the following keys
key | required | description |
---|---|---|
template_id | Yes | ID of the template (open-graph-image-1 , tweet-image-1 , beautify-screenshot-1 , ...) |
modifications | Yes | Modifications for the selected template. |
response_type | No | base64 , binary , url (Defaults to base64 ). |
response_format | No | png , webp , pdf , jpg , jpeg (Defaults to png ). |
For available templates and their modifications refer Orshot Templates Page
generate_signed_url
Use this function to generate signed URL. This method accepts a hash with the following keys
key | required | description |
---|---|---|
template_id | Yes | ID of the template (open-graph-image-1 , tweet-image-1 , beautify-screenshot-1 , ...) |
modifications | Yes | Modifications for the selected template. |
expires_at | Yes | Expires at in unix timestamp (Number). |
render_type | No | images , pdfs (Defaults to images ). |
response_format | No | png , webp , pdf , jpg , jpeg (Defaults to png ). |