PoP SDK - Vue

This is a library that allows you to easily integrate PoP into your Vue application.

Installation

npm install @anima-protocol/personhood-sdk-vue
# or
yarn add @anima-protocol/personhood-sdk-vue

Usage

Use the Personhood component

<template>
  <PersonhoodSdk
    session-id="01234567-8901-2345-6789-012345678901"
    address="0x1234567890123456789012345678901234567890"
    :sign="sign"
    @finish="finish"
  />
</template>

<script>
import PersonhoodSdk from "@anima-protocol/personhood-sdk-vue";

export default {
  name: 'App',
  components: {
    PersonhoodSdk
  },
  methods: {
    async sign(payload) {
      // Sign the payload with your wallet

      return payload; // TODO: replace with your signature
    },
    finish({ info, state }) {
      console.log('info', info)
      console.log('state', state)
    }
  },
}
</script>

The finish callback will be called when the user has finished the PoP flow or if the session is already validated. It's parameters follows the ones sent from the Personhood API session object.