Dev and staging environments for a Javascript SDK

Viewed 104

I have a Javascript SDK that is published to NPM. I also have a Vue app that uses the SDK and I need to be able to test them together in different pre-prod environments (e.g. staging). My questions are:

  1. What is the best way to manage pre-production versions of the SDK? It doesn't seem good to put them on the public NPM, since they only need to be accessible to my team.
  2. What is the best way to manage the different environments for the app that uses the SDK to allow for easy switching of environments when testing.
3 Answers
  1. You can use a private npm-registry that proxies to npmjs. Checkout https://verdaccio.org/

  2. You can publish your sdk package with tags like dev, stg and in your app use those tagged versions based on env

You can use NPM or YARN with Git Directly, so you can create a private repo on your fav Git System and then use username:password@ the URL E.G https://username:password@github.com/git/git.git so this is private and secured Git that is then used by your dev team.

To then make it public you would pull request into your public Repo and create the npm package from that public repo.

Related