1.1.3 • Published 7 months ago

vue-telegram-logger v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

VTL

⚠️ Use at your own risk!

Currently there is no way to hide the bot token and chat id when sending a request (you can see them in the developer tool by going to the Network tab). I plan to fix this in the near future, if you have any ideas how to do it, write to Telegram (@aslbekkucharov).

🪵 Vue Telegram Logger - small package for Vuejs to send your messages to Telegram group. You can use it for any purpose, e.g to send error logs of your Vue app to Telegram. This way you will get a fast response to errors from users.

Install

Via package managers

$ npm install vue-telegram-logger

# yarn
$ yarn add vue-telegram-logger

Usage

import { Vtl } from 'vue-telegram-logger'

Vue.use(Vtl, options)

Example

Sending message

// Vue 3 SomeVueComponent.vue

<script>
import { inject } from 'vue

const $vtl = inject('$vtl')

$vtl.sendLog('Your message')

</script>

// Vue 2 SomeComponent.vue

<script>

export default {
  methods: {
    fetchData() {
      try {
        // fetch logic
      } catch(e) {
        this.$vtl.sendLog('Error is: ' + e.message)
      }
    }
  }
}

</script>

Options

ParamDefault valueRequiredDescription
chatId string or number-trueYour chat id where messages will be sent
token string-trueTelegram bot token
codeLang stringjsfalseLanguage to highlight in telegram

sendLog options

ParamDefault valueRequiredDescription
lang stringjsfalseLanguage to highlight in telegram
shouldBeFormatted booleanfalsefalseIf set to true, message will be sent as monospace format

License

MIT

Copyright (c) 2022-present, aslbekkucharov

1.1.1

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.0

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago