tru.ID CLI: now with plugin support and a new development server plugin

by Paul McGuire | March 18, 2021
tru.id CLI dev server plugin

For IDlayr to be successful we have to make you, the developer, successful. One of the ways we’re doing this is by building and open-sourcing our developer tools. The IDlayr CLI is one such tool and today we’re excited to share an update that will make getting started and building with IDlayr even easier.

The latest version of the IDlayr CLI comes with plugin support along with a new `server` plugin. This update will:

  • enable mobile developers to focus on getting started with IDlayr and integrating mobile authentication into existing mobile apps without having to setup a back-end (initially)
  • improve our Quick Start/Getting Started docs and tutorials by removing the need for back-end setup steps, so you can get to writing code or seeing an example in action ASAP
  • let you try out some examples directly from the development server

tru.ID CLI plugin support

Our CLI is built upon the fantastic Oclif Open CLI Framework by the folks at Heroku. Oclif comes with support for plugins via a “plugins” plugin, that enables you to build CLIs with a plugin architecture and also support plugins to be added and removed on the fly.

The ability to manage plugins on the fly lets us try out new functionality within our CLI without having to push a new main CLI release. It also opens up the possibility for you to build plugins that make you and other developers more productive.

To get started with our CLI run:

You can then run the following and you can now run a new `tru plugins` command.

As mentioned, the `tru plugins` command now lets us experiment with new features, and will allow others to contribute their own plugins.

The Development Server Plugin

Ordinarily, you would need to clone a git repository, configure the cloned application, install a localtunnel solution, start the server, and start the localtunnel. The localtunnel solution is required for mobile development because you’ll likely want to try the application only connected to the mobile network and not a local network. All this feels like painful overhead – so we’ve simplified it.

With the release of the IDlayr CLI development server plugin we have removed a number of those steps by incorporating a development server and localtunnel solution within a CLI plugin. A big thanks to localtunnel.me for letting us use their awesome service.

With the IDlayr CLI installed, install the development server plugin:

Create an IDlayr project:

Run the development server:

You’ll then see your development server running with a localtunnel:

You can then navigate to `http://localhost:8080` to see a basic page served by the dev server. You can also navigate to `https://{generated-sub-domain}.loca.lt` (`{generated-sub-domain}` will be an actual generated sub-domain) where you’ll first see a prompt reminding you that `This website is served via a localtunnel`. After clicking `Click to Continue` you’ll see the same site served via a public URL.

With the dev server up and running with a public URL, you can then focus on setting up one or all of our example applications:

Try it out / Provide feedback

We believe that this CLI feature and new plugin is one more step towards enabling you to be more successful on our platform, and we’d love to hear what you think. Please message us on Twitter or send us an email.