@cmts-dev/carmentis-desk-connect-vuejs
v1.1.0
Published
Vue.js components for connecting to Carmentis Desk via relay protocol.
Readme
@cmts-dev/carmentis-desk-connect-vuejs
Vue.js components for connecting to Carmentis Desk via relay protocol.
Installation
npm install @cmts-dev/carmentis-desk-connect-vuejs
# or
pnpm add @cmts-dev/carmentis-desk-connect-vuejsUsage
Authentication Popup
<script setup>
import { ref } from 'vue';
import { CarmentisAuthPopup } from '@cmts-dev/carmentis-desk-connect-vuejs';
import '@cmts-dev/carmentis-desk-connect-vuejs/style.css';
const showAuth = ref(false);
const handleAuthResponse = (response) => {
console.log('Public key:', response.publicKey);
console.log('Signature:', response.signature);
};
const handleError = (error) => {
console.error('Error:', error);
};
</script>
<template>
<CarmentisAuthPopup
v-model:visible="showAuth"
relay-url="https://relay.testnet.carmentis.io"
challenge="dGVzdA=="
@response="handleAuthResponse"
@error="handleError"
/>
</template>Event Approval Popup
<script setup>
import { ref } from 'vue';
import { CarmentisApprovalPopup } from '@cmts-dev/carmentis-desk-connect-vuejs';
import '@cmts-dev/carmentis-desk-connect-vuejs/style.css';
const showApproval = ref(false);
const handleApprovalResponse = (response) => {
console.log('VB Hash:', response.b64VbHash);
console.log('MB Hash:', response.b64MbHash);
console.log('Height:', response.height);
};
</script>
<template>
<CarmentisApprovalPopup
v-model:visible="showApproval"
relay-url="https://relay.testnet.carmentis.io"
anchor-request-id="1234"
server-url="https://server.testnet.carmentis.io"
@response="handleApprovalResponse"
/>
</template>Development
Project Setup
pnpm installCompile and Hot-Reload for Development
pnpm devType-Check, Compile and Minify for Production
pnpm buildRelease
This project uses semantic-release for automated versioning and publishing.
Commit Convention
Follow Conventional Commits:
feat: add new feature→ Minor version bump (0.x.0)fix: fix bug→ Patch version bump (0.0.x)feat!: breaking change→ Major version bump (x.0.0)chore:,docs:,style:,refactor:,test:→ No release
Publishing
- Set up
NPM_TOKENsecret in GitHub repository settings - Push commits to
mainbranch - GitHub Actions will automatically:
- Build the project
- Run semantic-release
- Publish to npm
- Create GitHub release with changelog
License
MIT
