Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

rack-deduce-ingest

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-deduce-ingest

bundlerRubygems
Version
0.0.1
Version published
Maintainers
2
Created
Source

Rack::Deduce::Ingest

Rack middleware for Deduce's data ingestion API.

Installation

Add this line to your application's Gemfile:

gem 'rack-deduce-ingest'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-deduce-ingest

Usage

Configuration

Rack::Deduce::Ingest requires a Site ID and apikey, provided by Deduce. If you have not been given one, please contact Deduce for more information.

Rails

A Railtie is included in this gem which will load the middleware automatically. You will need to set the middleware parameters in your app configuration:

config.deduce_ingest.site_id = "your site id here"
config.deduce_ingest.apikey  = "your apikey here"

Sinatra, etc.

use Rack::Deduce::Ingest, "your site id here", { :ssl => false }
helpers Rack::Deduce::Ingest::Helpers

Sending Data to Deduce

Within your view, use the helper +deduce_ingest_html+ to include the Javascript collection code.

deduce_ingest_html("user@example.com")

You may send an options hash if you need to override any of the configuration options.

deduce_ingest_html("user@example.com", ssl: false)

For a Rails site, be sure to mark the output as html safe.

Sending Events to Deduce

Within your controller, use the helper +deduce_event_post+ to notify Deduce of events.

deduce_event_post('marzelize', "user@example.com")

Depending on the event type, additional data be send by passing an additional hash. You should consult with Deduce support for specific parameters and event types.

deduce_event_post('marzelize', "user@example.com", {weather: 'cloudy'})

Best Practices

  • Only pass information that you have already verified to be valid.

  • Work closely with your Deduce support representative.

FAQs

Package last updated on 03 Oct 2019

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