DAB-js Update: Optional Parameters & Interface Changes šŸ§°

Weā€™re updating the DAB-js interface to allow for optional parameters (e.g. passing an agent), which will modify the integration flow for DAB & Apps using DAB-js.

DAB
DABā€Šā€”ā€ŠAn open internet service.
2 min readNov 16, 2021

--

Time for an update to DAB-js! Weā€™re redesigning the interface to accommodate a more flexible flow for developers by allowing some parameters in certain calls to be optional (e.g. the Agent).

This means that today, weā€™re introducing a breaking change that can affect the integration of some UIā€™s/apps have using the previous interface. We apologize for any inconvenience, we believe it is important to make this change early on so that the interface can grow without this restriction.

But itā€™s a very simple change! So adapting and updating will take a second.

Interface Changes in DAB-js šŸ§°

What was the change introduced?

All methods in DAB-js used to receive multiple parameters at once. You can see an example highlighted below when using getNFTActor.

The difference is that now you only need to pass one parameter, which is an object that inside holds the multiple parameters that you previously had to send individually/separately.

As simple as going from getNFTActor(canisterId, agent, standard); to āž” this new format with the objectā€™s curly brackets: getNFTActor({canisterId, agent, standard});.

Adjusting your integration is as easy as following this new interface format.

Why Make this Adjustment in the Interface? šŸ¤” Flexibility šŸŒˆ

The previous design for DAB-js and its interface had optional parameters that couldnā€™t be removed, like the agent, and that caused potential issues for some developers (when it didnā€™t make sense for them to use the agent at all, in certain scenarios).

With this new parameters object, optional parameters such as the agent can be removed without causing any type of conflicts!

Wrapping it up šŸ—žļø

Thatā€™s it for today! An update to ensure DAB is future-proofed and flexible enough for any developer wishing to integrate it into its

--

--

DAB
DABā€Šā€”ā€ŠAn open internet service.

DAB is an Internet Computer open internet service for NFT, token, canister, and Dapp registries.