New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

hapi-drip

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-drip

Makes the [Drip Node client](https://github.com/samudary/drip-nodejs) available through Hapi mechanisms.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-drip

Makes the Drip Node client available through Hapi mechanisms.

ONLY WORKS WITH HAPI V17+

Install

npm i hapi-drip

OR

yarn add hapi-drip

Usage

Here's a very simple example:

Registering the plugin

  const server = new Hapi.Server()
  const plugin = {
    plugin: require('hapi-drip'),
    options: { accountId: 'your account id', token: 'your api token' }
  }

  await server.register(plugin)

Accessing the plugin

The plugin is available at both server.drip and request.drip.

  server.route({
    method: 'GET',
    path: '/',
    config: {
      handler: (request, h) => {
        
        const { drip } = request;

        await drip.recordEvent({
            events: [{
                email: 'ned@stark.org',
                action: 'Signed up'
            }]
        });
      }
    }
  })

More information

For details on drip-nodejs, click here.

For details on the Drip REST API, click here.

Keywords

hapi

FAQs

Package last updated on 28 Jun 2018

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