Star

Created With

linktyfon install

phonelink Client-Side Command

alt_route Alias: tyfon i



Installs (or updates) TyFON SDK for given URL.

👉 The URL MUST be that of a TyFON server.

1link$tyfon i localhost:8000

# # 🚚 Installing TyFON SDK for localhost:8000 ... # ... # # 📦 TyFON SDK for http://localhost:8000 ( @api/my-tyfon-server ) installed successfully! #

The SDK package will be named @api/<server-name>, where <server-name> is specified in package.json of the TyFON server code.

👉 Will add the URL to TyFON URLs in package.json ("tyfons" property).

warning IMPORTANT

If two TyFON servers on different URLs share the same name, the SDK installed later will be written over the SDK installed earlier.


👉 You can also provide multiple package names / URLs to the command:

1link$tyfon install localhost:8000 https://url-for-sdk2 ...


linkInstalling/Updating All SDKs

You can invoke tyfon install without any arguments to install/update all TyFON SDKs (fetched from package.json, "tyfons" property).

1link$tyfon install

👉 Will skip over SDKs it cannot fetch.


move_to_inbox FRESH INSTALLS

For fresh install of a project that uses TyFON SDKs, you need to install TyFON SDKs before other NPM packages:

1link$tyfon i # --> first install TyFON SDKs

2link$npm i # --> then install other packages


linkEnvironment Management

You might want to use different URLs of a service for different environments. For example, during development, you might want to work with the development version of a TyFON server which runs on localhost:8000, but for production switch to https://my-tyfon-server.cloud.

For that purpose, you can provide the --env parameter to tyfon install to tag each URL with the environment it should be used in:

1link$tyfon i https://my-tyfon-server.cloud --env prod

2link$tyfon i localhost:8000 --env dev

👉 Setup your dev environment like this:

1link$tyfon i --env dev

👉 Build your client-code for production like this:

1link$tyfon i --env prod

If --env parameter is not provided and no argument is given to tyfon i, then it will only install SDKs that are NOT tagged for any particular environments.


When you install an SDK first time like this:

1link$tyfon i localhost:8000 --env dev

Further updates, i.e.:

1link$tyfon i localhost:8000 # --> localhost:8000 still will be for dev env

will preserve the environment marked for localhost:8000, unless you explicitly specify a new environment via --env parameter:

1link$tyfon i localhost:8000 --env test # --> the environment will now change to test



tyfon installInstalling/Updating All SDKsEnvironment Management

Home Conventions Error Handling

CLI Referencechevron_right
Advanced Usagechevron_right