Repository: halitsever/nuxt-telegram-auth Branch: main Commit: 6f65be579def Files: 35 Total size: 23.5 KB Directory structure: gitextract_7hlm4j7g/ ├── .editorconfig ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ ├── ci.yml │ └── docs.yaml ├── .gitignore ├── .npmignore ├── .npmrc ├── .prettierrc ├── .vscode/ │ └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs/ │ ├── .vitepress/ │ │ └── config.ts │ ├── index.md │ ├── installation.md │ └── properties.md ├── eslint.config.mjs ├── package.json ├── playground/ │ ├── app.vue │ ├── nuxt.config.ts │ ├── package.json │ ├── server/ │ │ └── tsconfig.json │ └── tsconfig.json ├── src/ │ ├── module.ts │ └── runtime/ │ ├── app/ │ │ └── composables/ │ │ └── session.ts │ ├── components/ │ │ └── TelegramLoginWidget.vue │ ├── server/ │ │ ├── api/ │ │ │ └── telegram/ │ │ │ ├── session.delete.ts │ │ │ └── session.get.ts │ │ └── tsconfig.json │ └── types/ │ └── session.ts ├── test/ │ ├── basic.test.ts │ └── fixtures/ │ └── basic/ │ ├── app.vue │ ├── nuxt.config.ts │ └── package.json └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] indent_size = 2 indent_style = space end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false ================================================ FILE: .github/dependabot.yml ================================================ # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file version: 2 updates: - package-ecosystem: "npm" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "weekly" ================================================ FILE: .github/workflows/ci.yml ================================================ name: ci on: push: branches: - main pull_request: branches: - main jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: corepack enable - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npx nypm@latest i - name: Lint run: npm run lint test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: corepack enable - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npx nypm@latest i - name: Prepare For Dev run: npm run dev:prepare - name: Test run: npm run test ================================================ FILE: .github/workflows/docs.yaml ================================================ # Sample workflow for building and deploying a VitePress site to GitHub Pages # name: Deploy VitePress site to Pages on: # Runs on pushes targeting the `main` branch. Change this to `master` if you're # using the `master` branch as the default branch. push: branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: pages cancel-in-progress: false jobs: # Build job build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 # Not needed if lastUpdated is not enabled # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun - name: Setup Node uses: actions/setup-node@v3 with: node-version: 18 cache: npm # or pnpm / yarn - name: Setup Pages uses: actions/configure-pages@v5 - name: Install dependencies run: npm ci # or pnpm install / yarn install / bun install - name: Build with VitePress run: | npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build touch docs/.vitepress/dist/.nojekyll - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: docs/.vitepress/dist # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} needs: build runs-on: ubuntu-latest name: Deploy steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 ================================================ FILE: .gitignore ================================================ # Dependencies node_modules # Logs *.log* # Temp directories .temp .tmp .cache # Yarn **/.yarn/cache **/.yarn/*state* # Generated dirs dist # Nuxt .nuxt .output .data .vercel_build_output .build-* .netlify # Env .env # Testing reports coverage *.lcov .nyc_output # VSCode .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json !.vscode/*.code-snippets # Intellij idea *.iml .idea # OSX .DS_Store .AppleDouble .LSOverride .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk # Vitepress /docs/.vitepress/cache ================================================ FILE: .npmignore ================================================ /docs ================================================ FILE: .npmrc ================================================ shamefully-hoist=true strict-peer-dependencies=false ================================================ FILE: .prettierrc ================================================ { "tabWidth": 2, "useTabs": false, "printWidth": 220 } ================================================ FILE: .vscode/settings.json ================================================ { "eslint.experimental.useFlatConfig": true } ================================================ FILE: CHANGELOG.md ================================================ # Changelog ## v1.2.6 [compare changes](https://github.com/halitsever/nuxt-telegram-auth/compare/v1.2.5...v1.2.6) ### 🩹 Fixes - **session.get:** Handle nullish telegram token ([bb97043](https://github.com/halitsever/nuxt-telegram-auth/commit/bb97043)) ### ❤️ Contributors - Halit Sever ([@halitsever](https://github.com/halitsever)) ## v1.2.5 [compare changes](https://github.com/halitsever/nuxt-telegram-auth/compare/v1.2.4...v1.2.5) ### 🩹 Fixes - Remove module options ([b721fd6](https://github.com/halitsever/nuxt-telegram-auth/commit/b721fd6)) ### ❤️ Contributors - Halit Sever ([@halitsever](https://github.com/halitsever)) ## v1.2.4 [compare changes](https://github.com/halitsever/nuxt-telegram-auth/compare/v1.2.3...v1.2.4) ### 📖 Documentation - Update docs workflow ([bd91510](https://github.com/halitsever/nuxt-telegram-auth/commit/bd91510)) ### 🏡 Chore - Upgrade dependency versions ([2765271](https://github.com/halitsever/nuxt-telegram-auth/commit/2765271)) - Add compatibilityDate to nuxt.config ([6760493](https://github.com/halitsever/nuxt-telegram-auth/commit/6760493)) ### ❤️ Contributors - Halit Sever ([@halitsever](https://github.com/halitsever)) ## v1.2.3 [compare changes](https://github.com/halitsever/nuxt-telegram-auth/compare/v1.2.2...v1.2.3) ## v1.2.2 [compare changes](https://github.com/halitsever/nuxt-telegram-auth/compare/v1.2.0...v1.2.2) ### 🩹 Fixes - 🐛 eslint integration ([3c9754f](https://github.com/halitsever/nuxt-telegram-auth/commit/3c9754f)) - 🐛 test workflow ([34d20d8](https://github.com/halitsever/nuxt-telegram-auth/commit/34d20d8)) - 🐛 typo prepare:dev => dev:prepare ([da26bc3](https://github.com/halitsever/nuxt-telegram-auth/commit/da26bc3)) - **telegramloginwidget:** Update btoa function for utf8 ([a3ce167](https://github.com/halitsever/nuxt-telegram-auth/commit/a3ce167)) ### 📖 Documentation - ✏️ update features section ([fc44579](https://github.com/halitsever/nuxt-telegram-auth/commit/fc44579)) - ✏️ update features section ([fcf1c1e](https://github.com/halitsever/nuxt-telegram-auth/commit/fcf1c1e)) - Update image aligments ([dd39167](https://github.com/halitsever/nuxt-telegram-auth/commit/dd39167)) ### 🏡 Chore - 🤖 add npm run lint to release script ([269ced5](https://github.com/halitsever/nuxt-telegram-auth/commit/269ced5)) - **deps-dev:** Bump nuxt from 3.12.3 to 3.12.4 ([168e5e5](https://github.com/halitsever/nuxt-telegram-auth/commit/168e5e5)) - **deps-dev:** Bump serve-static from 1.15.0 to 1.16.2 ([ae66e1f](https://github.com/halitsever/nuxt-telegram-auth/commit/ae66e1f)) - **deps-dev:** Bump @types/node from 20.14.10 to 22.7.4 ([bd9663d](https://github.com/halitsever/nuxt-telegram-auth/commit/bd9663d)) - **deps-dev:** Bump vite from 5.3.5 to 5.4.8 ([b1149f4](https://github.com/halitsever/nuxt-telegram-auth/commit/b1149f4)) - **deps-dev:** Bump @nuxt/schema from 3.12.4 to 3.13.2 ([1c62687](https://github.com/halitsever/nuxt-telegram-auth/commit/1c62687)) - **deps-dev:** Bump eslint from 9.6.0 to 9.12.0 ([3418ff4](https://github.com/halitsever/nuxt-telegram-auth/commit/3418ff4)) - **deps-dev:** Bump vitest from 1.6.0 to 2.1.2 ([3bb8589](https://github.com/halitsever/nuxt-telegram-auth/commit/3bb8589)) - **deps-dev:** Bump rollup from 3.29.4 to 3.29.5 ([7551df1](https://github.com/halitsever/nuxt-telegram-auth/commit/7551df1)) - **deps-dev:** Bump vue-tsc from 2.0.26 to 2.1.6 ([4340bea](https://github.com/halitsever/nuxt-telegram-auth/commit/4340bea)) - **package.json:** Bump nuxt to 3.17.1 ([d4e28b5](https://github.com/halitsever/nuxt-telegram-auth/commit/d4e28b5)) ### ❤️ Contributors - Halit Sever ([@halitsever](http://github.com/halitsever)) ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2024 Halit Sever Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================
🔐 A telegram login widget integration for nuxt 3
MIT LICENSE | Halit Sever
================================================ FILE: docs/.vitepress/config.ts ================================================ import { defineConfig } from "vitepress"; // https://vitepress.dev/reference/site-config export default defineConfig({ title: "Nuxt Telegram Auth", description: "Effortlessly integrate the Telegram login widget into your Nuxt 3 application with our easy-to-use npm package, enhancing user authentication and engagement.", base: "/nuxt-telegram-auth/", themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ { text: "Home", link: "/" }, { text: "Quick Start", link: "/installation" }, ], sidebar: [ { text: "Documentation", items: [ { text: "Quickstart", link: "/installation" }, { text: "Properties", link: "/properties" }, ], }, ], socialLinks: [{ icon: "github", link: "https://github.com/halitsever/nuxt-telegram-auth" }], }, }); ================================================ FILE: docs/index.md ================================================ --- # https://vitepress.dev/reference/default-theme-home-page layout: home hero: name: "Nuxt Telegram Auth" tagline: 🔐 Telegram login widget integration for Nuxt 3 actions: - theme: brand text: Documentation link: /installation - theme: alt text: Github link: https://github.com/halitsever/nuxt-telegram-auth image: src: /telegram-logo.png alt: Nuxt Telegram Auth --- ================================================ FILE: docs/installation.md ================================================ # Installation First of all you need a telegram bot, if you don't know to how to create a telegram bot please check this link. # Step 1: Install the module: ```bash npx nuxi module add nuxt-telegram-auth ``` # Step 2: You need grab bot token from telegram, you can get your bot's token from Bot_Father:
Then add your nuxt.config.ts file:
```javascript
runtimeConfig: {
TELEGRAM_TOKEN: "my_fancy_bot_token",
}
```
also you need allow your domain on Bot_Father otherwise you will get "Invalid Domain" error.
After that you can use `TelegramLoginWidget` component:
```javascript
Session: {{ session }}