Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-embed

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-embed

  • 0.1.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Canvas::Embed

This Gem allows you to generate signed tokens that grant access to your Canvas embeds.

Your application frontend can then use these tokens in the Canvas React component to display your Canvas embeds in your application.

Each token should be configured with the set of scopes that are approriate for the user, granting them access to only their data.

If any scopes are required by your charts that are not present in the scopes payload, the request will fail.

You can view how this Gem is used in a sample rails app in the example/ directory

Usage

Add gem 'canvas-embed' to your Gemfile, then:

# key is the private key from Canvas
# scopes is the Hash of scopes to grant the user
# expiration_seconds is the duration in seconds for the token to be valid (default is one hour)
# user_id is an optional user identifier that will be used in Canvas' logging
Canvas::Embed.generate_embed_token(key, scopes, expiration_seconds, user_id)

Running tests

rspec

Canvas publishing

# increment the version in version.rb
# build the new gem
rake build
# outputs new gem path eg 'canvas-embed 0.1.1 built to pkg/canvas-embed-0.1.1.gem'
# publish the new gem (need rubygems.org access) from the path above
gem push pkg/canvas-embed-0.1.1.gem

FAQs

Package last updated on 10 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc