https://github.com/wgr-sa/nuxt-octokit
Nuxt wrap for octokit
https://github.com/wgr-sa/nuxt-octokit
github nuxt octokit typescript
Last synced: 6 months ago
JSON representation
Nuxt wrap for octokit
- Host: GitHub
- URL: https://github.com/wgr-sa/nuxt-octokit
- Owner: WGR-SA
- License: mit
- Created: 2025-01-27T16:32:13.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-30T09:14:41.000Z (12 months ago)
- Last Synced: 2025-03-24T18:49:35.244Z (10 months ago)
- Topics: github, nuxt, octokit, typescript
- Language: Vue
- Homepage:
- Size: 284 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nuxt Octokit Module
A Nuxt module that provides GitHub API integration via Octokit, with support for dynamic token management.
### Features
- 🔑 Dynamic GitHub token management
- 🔄 Reactive Octokit instance
## Installation
```BASH
npm i @wgr-sa/nuxt-octokit
```
### Add Module to nuxt.config.ts
```JS
export default defineNuxtConfig({
modules: [
'@wgr-sa/nuxt-octokit',
],
})
```
## Usage
Setting the GitHub Token
You can set the GitHub token after initialization, which is useful for auth flows:
```JS
const { $octokit } = useNuxtApp()
// Set token
$octokit.setToken('your-github-token')
// Check if initialized
if ($octokit.isInitialized) {
// Use Octokit
const response = await $octokit.instance.repos.getContent({
owner: 'owner',
repo: 'repo',
path: 'path'
})
}
// Clear token (e.g., on logout)
$octokit.clearToken()
```
## License
MIT License