Introducing the tru.ID CLI updates

by Paul McGuire | May 23, 2022
A screen showing the tru.ID CLI terminal.

IDlayr’s success depends on you, the developer, being successful. As previously stated, all of our developer tools are open-source and available to you. The IDlayr CLI is one of these tools, and today we’ve released a new version with several changes to make implementing SIM-based authentication with IDlayr even easier.

What are the updates?

The latest version of the IDlayr CLI contains several updates. These are summarised in the following bullet points and further explained in their own sections below:

  • oAuth2 support has been added to support your CLI setup and authentication of your account.
  • The `dev-server` has been removed as a feature in the CLI.
  • `–workflow` has been removed from the PhoneCheck (`phonechecks:create`) and SubscriberCheck (`subscriberchecks:create`) creation commands.

Authentication

In the previous version, the CLI only supported authentication with your workspace credentials (`client_credentials` grant), which you would have configured when running the command `tru setup`.

With the new version (v1.0.5), we’ve replaced this with `tru login`. You will need to enter the Identity Provider of your choosing from Google, GitHub, or Microsoft. Using this new functionality, you don’t need to find your credentials, but instead, use your trusted identity provider.

The Dev-Server command removal

With the PhoneCheck and SubscriberCheck API updates to version 0.2, more configuration is required for the developer demo server, and the decision was made to remove this feature as a plugin for the CLI and keep it as an independent repository. If you still wish to continue using the developer demo server, please clone the repository on GitHub.

How can I use the CLI?

Install

To install the CLI, you need npm (minimum version 14.0.0) installed locally on your machine; then in your Terminal, run the following command:

Before you can access anything with the CLI, you need to let it know who you are. You can log in with the following command, but be sure to choose the Identity Provider you chose when creating an account on IDlayr:

Workspaces

A workspace is a container for users’ accounts and billing accounts. There are two different kinds of workspaces you can belong to, and these are:

  • If you signed up to IDlayr on your own, you will have a workspace created for you. By default, you are the owner of this workspace — i.e. you’ll have full control of the projects and billing.
  • If you signed up to IDlayr through an invitation from another IDlayr user, you will by default join their workspace with the access level they have granted you — this could either be an admin or viewer. In addition, you will also have a separate workspace that you are the owner of.

You can view which workspaces you’re a member of by running the command:

You will need to choose which one is to be the active workspace for your CLI with the following command:

Projects

A project is a method for applications to access IDlayr APIs. A project serves two purposes:

  • To provide credentials. Each user within the workspace will need to generate their credentials, removing the need to share credentials for a project.
  • To logically group API calls. Having separate projects for specific purposes or applications increases security and improves tracking over the usage of each project.

With the CLI, you can carry out three commands for projects. These are listed in the examples below:

For more information on how to set up your environment for using IDlayr APIs, please check out the Set up your Environment page on the IDlayr Developer Docs.