Skip to content
This repository was archived by the owner on Aug 27, 2024. It is now read-only.

v2.0.0

Choose a tag to compare

@ganchoradkov ganchoradkov released this 16 Dec 10:48
· 71 commits to main since this release

What's Changed

Important changes when upgrading from 1.x to 2.0.0

  • BREAKING CHANGE authClient.respond(params, iss) requires an additional param iss
  • new formatMessage(payload, iss) added to format incoming auth requests

Usage example

authClient.on("auth_request", async ({ id, args }) => {

  // the user’s address
  const iss = `did:pkh:eip155:1:${WALLET_ADDRESS}`;

  // format the cacao payload with the user’s address
  const message = authClient.formatMessage(args.params.cacaoPayload, iss);
  
  // This is a good point to trigger a UI event to provide the user
  // with a button to accept or reject the authentication request,
  // instead of automatically responding.
  const signature = await wallet.signMessage(params.message);

  await authClient.respond({
    id: id,
    signature: {
      s: signature,
      t: "eip191",
    },
    iss,
  });
});

Full Changelog: 1.0.1...v2.0.0