0.0.13 • Published 2 months ago
@kmobi/vue v0.0.13
Vue 3 UI Component for the KodMobi Auth
Installation
NPM
npm install @kmobi/vue
Yarn
yarn add @kmobi/vue
Usage
Install plugin
App entrypoint (main.ts)
import {createApp} from 'vue'
import App from './App.vue'
import kodMobiPlugin from "@kmobi/vue"
import "@kmobi/vue/index.css"
createApp(App).use(kodMobiPlugin).mount('#app')
Use component
App.vue
<template>
<div>
<div>My awesome APP</div>
<KodMobiAuth
:base-url='baseUrl'
:api-key='apiToken'
@success='handleToken'
<!-- Optional. Default: true. Is show screen with the success message. If false the loader will be shown -->
:show-success-screen='true'
/>
</div>
</template>
<script setup lang='ts'>
import {KodMobiAuth} from "@kmobi/vue";
import {ref} from "vue";
const token = ref<string>('')
const apiToken = "" // Your API token
const baseUrl = "https://api.kod.mobi" // KodMobi API base url
const handleToken = (tokenOBj: {token: string}) => {
// Token for the Verify endpoint
token.value = tokenOBj.token
}
</script>