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

@affixapi/integrator

v1.0.11

Published

[![release](https://github.com/affixapi/integrator/actions/workflows/release.yml/badge.svg)](https://github.com/affixapi/integrator/actions/workflows/release.yml) [![codecov](https://codecov.io/github/affixapi/integrator/graph/badge.svg?token=wokk2l6k5i)]

Downloads

48

Readme

integrator

release codecov

Intro

Deploy a self-contained service that integrates with the Affix API within your infrastructure.

Affix API follows the OAuth 2.1 specification, which makes integrating as standardised as possible; this does require you coding to our API.

We also offer a no-code solution where we can drop the extracts over SFTP or AWS S3.

Somewhere inbetween is this service, which you can deploy to your cloud and does most of the integration for you.

Integrating Affix API: A Quick and Easy Demo 👍

Integrating Affix API: A Quick and Easy Demo 👍

Quickstart (local)

git clone [email protected]:affixapi/integrator.git && cd integrator

docker compose up

The service is now running @ localhost:8080

Quickstart (prod + connect your own DB)

docker pull ghcr.io/affixapi/integrator:latest

docker run --rm -it \
  --env-file .env \
  -e DB_CXN_STR=postgres://postgres:affixapi@postgres:5432/affixapi \
  -p 8080:8080 \
  integrator:latest \
  --name integrator \
  npm start

The service is now running @ localhost:8080

environment variables

export CLIENT_ID=''
export CLIENT_SECRET=''
export REDIRECT_URI='http://localhost:8080/callback'
export NODE_ENV=dev
export HOST=0.0.0.0 # interface the node server listens on. either `0.0.0.0` (for server running in docker or accepting non-local traffic) or `localhost` (for local testing)
export PORT=8080

export DB_CXN_STR='postgres://your-username:your-password@your-postgres-host:5432/affixapi' # if not using the postgres docker container
export POSTGRES_PASSWORD='your-postgres-password' # if launched via docker-compose only

dev

npm install
dev-resources/run-db # or configure your own DB with the DB_CXN_STR env var
npm run dev

dev/prod (with docker)

docker pull ghcr.io/affixapi/integrator:latest
# make sure to set the DB_CXN_STR env var the `.env` file
docker compose up

prod (without docker)

git clone [email protected]:affixapi/integrator.git && cd integrator
npm ci --production

# make sure to set the DB_CXN_STR env var

npm start

Production

You will need to deploy this within your production environment.

Two options:

  • use a load balancer for SSL termination, and forward request to a box hosting the service

In AWS speak, set up an Application Load Balancer (ALB), forward port 80 to port 443, and forward port 443 to either an EC2 box hosting the service, or one of the many AWS services (AWS Fargate, etc) that can host a docker container

  • create an SSH certificate

Next steps

  • Create a persistent database connection; either to your existing main database or a microservice data. Ensure that only respective teammates can access, as Affix tokens will be stored inside this DB.
  • Use a Key Management Service (such as AWS KMS) to store the Affix API keys in the DB as ciphertext. This ensures that even in the unlikely event of data exfiltration, the keys are not usable by non-internal team members.
  • Use a database connection pool

References / Sources