0.1.0-rc0 • Published 1 year ago

@anima_protocol/personhood-sdk-vue v0.1.0-rc0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

personhood-sdk-vue

Personhood SDK Vue

Install

With npm

npm install @anima_protocol/personhood-sdk-vue

With yarn

yarn add @anima_protocol/personhood-sdk-vue

Import

import AnimaPersonhood from '@anima_protocol/personhood-sdk-vue'

Usage

<template>
    <anima-personhood
      v-if="connectedWallet?.accounts[0].address"
      session-id="124b7409-62cb-418f-8d2d-444eabf6394f"
      storj-url="https://link.storjshare.io/raw/jxufayhv2itczfzykdcc7t3tdxgq/anima2"
      synaps-url="https://personhood-api-testnet-c2gchp5lzq-ez.a.run.app"
      :address="connectedWallet?.accounts[0].address"
      :sign="sign"
      @shared="shared"
    />
</template>

<script lang="ts">
import AnimaPersonhood, {
  SharedEvent
} from '@anima_protocol/personhood-sdk-vue'
export default {
  name: 'App',
  components: {
    AnimaPersonhood
  },
  methods: {
    async sign(payload: string) {
        return await WALLET.sign(payload)
      }
    },
    shared(payload: SharedEvent) {
      console.log(payload)
    }
  }
}
</script>

Props list

Prop nameProp typeDefaultRequiredDescription
session-idstring''YSession can be referred as a customer verification session. More info
addressstring''YYour user account Web3 wallet address
chain-idstring'1'NYour Web3 wallet chain id
sign(data: string) => voidundefinedYThis event is triggered when the user wants to sign their proof to share it or create an anima
onShared(data: SharedEvent) => voidundefinedYThis event is triggered when the user has shared their proof. The function has one parameter a SharedEvent.verified is True when the user is successfull onboarded

Examples

License

Apache 2.0 © Anima