Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/restorm-labs/nuxt-restream
Restream is a module that allows you to create a stream of an audio/video file from the Firebase storage, protected from direct download through the client-side.
https://github.com/restorm-labs/nuxt-restream
firebase firebase-storage nuxt nuxt-module nuxt3 security vue3
Last synced: about 2 hours ago
JSON representation
Restream is a module that allows you to create a stream of an audio/video file from the Firebase storage, protected from direct download through the client-side.
- Host: GitHub
- URL: https://github.com/restorm-labs/nuxt-restream
- Owner: restorm-labs
- License: mit
- Created: 2022-06-23T19:28:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-28T11:15:25.000Z (over 2 years ago)
- Last Synced: 2024-11-08T04:39:04.781Z (11 days ago)
- Topics: firebase, firebase-storage, nuxt, nuxt-module, nuxt3, security, vue3
- Language: TypeScript
- Homepage: https://twitter.com/restormlabs
- Size: 131 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## nuxt-restream
> Restream is a module that allows you to create a stream of an audio/video file from the Firebase storage, protected from direct download through the client. Convenient to use if needed provide media files with restricted access such as purchase, subscription and avoid downloading the file directly from the Firebase storage on the client-side
## Features
- 🤓 Very easy to use
- 🛡 Direct download protection
- 🔥 Setup for Firebase Admin
- 🟢 Nuxt 3## Quick setup
1. Install `nuxt-restream`
```bash
yarn add --dev firebase-admin nuxt-restream # or npm install --save-dev firebase-admin nuxt-restream
```2. Add it to the `modules` section of `nuxt.config.ts`
```js
import { defineNuxtConfig } from 'nuxt'export default defineNuxtConfig({
modules: ['nuxt-restream']
})
```3. Basic configuration `restream` setup for accessing Firebase [Get JSON file with credential Admin Firebase](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk)
```js
import { defineNuxtConfig } from 'nuxt'export default defineNuxtConfig({
restream: {
credential: './firebase-admin-sdk.json',
storage: 'firebase-storage-name.appspot.com'
}
})
```4. Add `src` attribute with a link to server routes `/api/restream` with the `?f=` parameter containing the path to the file in Firebase storage.
```vue
```## Configuration
Restream supports a number of options, which you can pass in your `nuxt.config.ts` file:
```js
import { defineNuxtConfig } from 'nuxt'export default defineNuxtConfig({
// ...
restream: {
/**
* Path (relative to your base URL) where the JSON file with Firebase admin credentials.
* @example './assets/fearbook-c8d55-firebase-adminsdk-vbvi5-57b761f13c.json'
* @default undefund
*/
credential: string,/**
* Firebase storage bucket url
* @example 'fearbook-c8d55.appspot.com'
* @default undefund
*/
storage: string,/**
* Base route that will be used for restream api
* @example 'restream' -> 'api/restream?f=...'
* @default 'restream'
*/
apiRouteName: string
},
})
```## Licence
[MIT Licence](./LICENCE)