Skip to content

🔴 Receives payloads then sends them to your local server

License

Notifications You must be signed in to change notification settings

probot/smee-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smee-client

Client and CLI for smee.io, a service that delivers webhooks to your local development environment.

NPM Build Status Codecov

Looking for probot/smee.io?

Installation

Install the client with:

npm install -g smee-client

Usage

CLI

The smee command will forward webhooks from smee.io to your local development environment.

smee

Run smee --help for usage.

Node Client

const SmeeClient = require('smee-client')

const smee = new SmeeClient({
  source: 'https://smee.io/abc123',
  target: 'http://localhost:3000/events',
  logger: console
})

const events = smee.start()

// Stop forwarding events
events.close()

Proxy

By default, the Smee client does not make use of the standard proxy server environment variables. To add support for proxy servers you will need to provide an https client that supports them such as undici.EnvHttpProxyAgent().

Afterwards, you will be able to use the standard proxy server environment variables.

For example, this would use a EnvHttpProxyAgent to make requests through a proxy server:

const { EnvHttpProxyAgent, fetch: undiciFetch } = require("undici");
const SmeeClient = require('smee-client');

const myFetch = (url, options) => {
  return undiciFetch(url, {
    ...options,
    dispatcher: new EnvHTTPProxyAgent()
  })
};

const smee = new SmeeClient({
  source: 'https://smee.io/abc123',
  target: 'http://localhost:3000/events',
  logger: console,
  fetch: myFetch
});

const events = smee.start();