Plug (V0.2.1) & the PlugAgent - Apps can Integrate Plug to Authenticate Users!

All right we’ve got some exciting news on Plug.

V0.2.1 (download it here) is out with a big addition, key for Plug-app integrations… The PlugAgent!

As of V0.2.1, devs can integrate Plug into their apps to support it as an authentication provider, and proxy-sign canister requests with the user’s identity in Plug. That’s done interacting with Plug through the IC Provider API in the browser’s window object, and through there using the PlugAgent (a proxy for DFINITY’s agent-js agent module).

Meaning users could now sign into any integrated IC app from their wallet in Plug, with a click in a confirmation pop-up, and interact with your app smoothly (while in the background you sign the necessary canister request through the agent). And since their identity is also their wallet, apps could surface/interact with the user’s balances too (e.g. trigger a transaction based on an app action).

Here’s the full brief and breakdown :point_down:

There’s also a second surprise we built to showcase all of this live… The Coinflip game app! A demo app build that’s integrated to support Plug as an auth option, with a simple coinflip guess game, and a leaderboard/ranking of users.

pluc

That’s all it takes to authenticate a user using their wallet in Plug as their identity (their Principal ID) :arrow_double_up:


Any feedback on the integration flow, the interactions with the IC Provider API, and the PlugAgent is welcome :raised_hands: You can see how to integrate it here, or use one of our reference app examples / implementations as a guide. We also created a template/package for that “Connect to Plug” button seen above, ready to go.

4 Likes

Hey, I was looking into integrating plug to pay for a service. I can pretty much follow along the “buy me a coffee” example, as that part is clear enough. What I was wondering was how can I check for the payment on the canister side? (e.g. provide access to a service based on paying some ICP).

Hey GLdev! Hop on our Discord, our devs can help with ideas for that :slight_smile:

hi, nico! Our website wants to use plug to log in and trade, but there are some problems that can not be solved in time on discord.

  1. I need to perform secondary verification of memo. But the plug can’t send memo normally. Can you handle this problem
  2. After the user initiates the transaction, I cannot close the transaction. If the user doesn’t pay, I can only lock my product all the time. I can’t take the initiative to close the transaction.

Super duper! Looking great ^^

When you say trade tokens are you intending to integrate tokens such as one we can find on DSCVR? Will there be a market where we can trade these tokens across IC websites?