Anna
Anna

Reputation: 65

Dev and staging environments for a Javascript SDK

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.

Upvotes: 5

Views: 123

Answers (3)

g.carey
g.carey

Reputation: 710

You can use the local version of the javascript SDK package (pulled down from a shared devlopment git branch) in your vue app using npm link https://docs.npmjs.com/cli/v7/commands/npm-link

Upvotes: 1

Barkermn01
Barkermn01

Reputation: 6842

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:[email protected]/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.

Upvotes: 0

asyncninja
asyncninja

Reputation: 396

  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

Upvotes: 2

Related Questions