npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@embetty/server

v3.2.5

Published

[Embetty](https://github.com/heiseonline/embetty) displays remote content like tweets or YouTube videos without compromising your privacy. `embetty-server` acts as a proxy and provides the necessary data.

Downloads

15

Readme

embetty-server · Build Status Dependency Status JavaScript Style Guide

Embetty displays remote content like tweets or YouTube videos without compromising your privacy. embetty-server acts as a proxy and provides the necessary data.

Embetty server can be run in two different ways:

It's necessary to configure a reverse proxy to make Embetty server reachable either way.

Running Embetty server with Docker

The docker image exposes the server on port 8080 and can be configured using environment variables.

$ docker run \
  -p 8080:8080 \
  --name embetty \
  --rm \
  -e VALID_ORIGINS=https://example.com \
  -e TWITTER_ACCESS_TOKEN_KEY=... \
  -e TWITTER_ACCESS_TOKEN_SECRET=... \
  -e TWITTER_CONSUMER_KEY=... \
  -e TWITTER_CONSUMER_SECRET=... \
  heiseonline/embetty-server:latest

Running Embetty server with a process manager

This requires Node.js version 8 or later.

  1. Install Embetty server by running yarn global add @embetty/server. This makes the embetty command available on the server.
  2. Setup a process manager like Forever, PM2 or StrongLoop Process Manager.
  3. Configure the Process manager to run embetty start. The command embetty start --help prints a list of all supported options.

Configuration

Embetty server can be configured using the following environment variables:

| Variable | Required | Description | | ----------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | URL_BASE | no | The base URL of the Embetty server instance, e.g. https://my-server.com/path/to/embetty. | | DEBUG | no | This variable controls the output of log messages. You may set it to embetty.* to log all Embetty messages to STDOUT. | | EMBETTY_CACHE | no | Connection string of a cache adapter. Currently Redis (example: redis://) and LRU (example: lru://) are supported. | | PORT | no | This variable can be used to specify the port on which Embetty Server listens. Default: 3000 | | TWITTER_ACCESS_TOKEN_KEY | [1] | Twitter Access Token | | TWITTER_ACCESS_TOKEN_SECRET | [1] | Twitter Access Token Secret | | TWITTER_CONSUMER_KEY | [1] | Twitter consumer Key (API Key) | | TWITTER_CONSUMER_SECRET | [1] | Twitter consumer Secret (API Secret) | | VALID_ORIGINS | yes | Contains a comma-separated list of allowed origins. Examples: https://example.com, https://a.example.com,https://b.example.com or *. |

Twitter

To display tweets with Embetty, the Twitter environment variables listed above need to be defined. Both tokens, the key and the secret can be obtained by creating a Twitter app.

Testing the server setup

The setup can be tested by sending a request to the running server. If everything was set up correctly, JSON data and the HTTP status code 200 are returned.

$ curl -i http://localhost:8080/version
$ curl -i http://localhost:8080/tweet/985882036777955328
$ curl -i http://localhost:8080/video/youtube/m6UOo2YGbIE-poster-image

Using Embetty with Google AMP ⚡️

Embetty server supports Google AMP ⚡️ out of the box via <amp-iframe>:

Tweet:

<amp-iframe
  width="200"
  height="100"
  sandbox="allow-scripts allow-same-origin"
  layout="responsive"
  resizable
  frameborder="0"
  src="https://your-site.com/path/to/embetty-server/tweet/1004988454978179072.amp"
>
  <div overflow tabindex="0" role="button" aria-label=""></div>
</amp-iframe>

Vimeo:

<amp-iframe
  width="200"
  height="100"
  sandbox="allow-scripts allow-same-origin"
  layout="responsive"
  resizable
  frameborder="0"
  src="https://your-site.com/path/to/embetty-server/video/vimeo/1084537.amp"
>
  <div overflow tabindex="0" role="button" aria-label=""></div>
</amp-iframe>

YouTube:

<amp-iframe
  width="200"
  height="100"
  sandbox="allow-scripts allow-same-origin"
  layout="responsive"
  resizable
  frameborder="0"
  src="https://your-site.com/path/to/embetty-server/video/youtube/m6UOo2YGbIE.amp"
>
  <div overflow tabindex="0" role="button" aria-label=""></div>
</amp-iframe>

Facebook:

<amp-iframe
  width="200"
  height="100"
  sandbox="allow-scripts allow-same-origin"
  layout="responsive"
  resizable
  frameborder="0"
  src="https://your-site.com/path/to/embetty-server/video/facebook/10156049485672318.amp"
>
  <div overflow tabindex="0" role="button" aria-label=""></div>
</amp-iframe>

Contributing to Embetty

See Contributing.

License

Embetty server is MIT licensed.