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.

Overview

Logo

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

    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

    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

    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.

    <template>
      <div>
        <audio src="/api/restream?f=path_to/audio.mp3" typeof="audio/mp3" controls />
      </div>
    </template>

    Configuration

Restream supports a number of options, which you can pass in your nuxt.config.ts file:

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

You might also like...

πŸ”Ž Algolia module for Nuxt

πŸ”Ž Algolia module for Nuxt

@nuxtjs/algolia Algolia module for Nuxt ✨ Release Notes πŸ“– Read the documentation Features Nuxt 3 ready Easy integration with Algolia Handy composable

Jan 7, 2023

Nuxt 3 module for Kirby's Query Language API

nuxt-kql Kirby KQL module for Nuxt 3. This module provides a useKql composable, which under the hood uses useFetch. Thus, KQL query fetching in your N

Dec 15, 2022

Nuxt 3 module for Web3.js

nuxt-web3.js Nuxt 3 module for Web3.js. Installation npm install nuxt-web3.js Usage export default defineNuxtConfig({ modules: ['nuxt-web3.js'], })

Dec 16, 2022

OpenID-Connect(OIDC) integration module for nuxt 3.0.

Nuxt OpenID-Connect OpenID-Connect(OIDC) integration module for nuxt 3.0. Features An Nuxt 3 module. OIDC integration ( implemetation base openid-clie

Dec 24, 2022

πŸ”Ž Meilisearch module for Nuxt 3

πŸ”Ž Meilisearch module for Nuxt 3

nuxt-meilisearch Meilisearch module for Nuxt Features Nuxt 3 Easy integration with MeilisearchJS lib Support for Vue Algolia Vue 3 InstantSearch compo

Dec 26, 2022

βœ‰οΈ Nuxt module for first class integration with popular newsletter providers

βœ‰οΈ Nuxt module for first class integration with popular newsletter providers

nuxt-newsletter Newsletter module for Nuxt 3 ✨ Release Notes πŸ“– Read the documentation Features Nuxt 3 ready Easy integration with Mailchimp, Revue, B

Jan 5, 2023

πŸ”Ž Algolia module for Nuxt

πŸ”Ž Algolia module for Nuxt

@nuxtjs/algolia Algolia module for Nuxt ✨ Release Notes πŸ“– Read the documentation Features Nuxt 3 ready Easy integration with Algolia Handy composable

Jul 28, 2022

A Nuxt.js module that injects a server route to serve the GraphQL Playground

@pin-pon/nuxt-graphql-playground A Nuxt.js module that injects a server route to serve the GraphQL Playground Setup Add @pin-pon/nuxt-graphql-playgrou

Sep 22, 2022

Make use css module more sense.

vite-plugin-sense-css-module Make use css module more sense. Installation npm npm install --save-dev vite-plugin-sense-css-module yarn yarn add -D vi

Sep 25, 2022
Releases(0.0.9)
Owner
Restorm
Creative. Develop. & More. - Modern art and web technology.
Restorm
xaboy 4.6k Jan 3, 2023
:bento: Full-Stack solution to quickly build PWA applications with Vue.js and Firebase

Welcome to bento-starter ?? ?? bento-starter is an Open-Source Full-Stack solution that helps you to build fast and maintainable web applications usin

Franck Abgrall 1.5k Dec 24, 2022
It's a react-redux app with firebase used as the database

This project was bootstrapped with Create React App, using the Redux and Redux Toolkit template. Available Scripts In the project directory, you can r

Sparsh Saxena 0 Jun 25, 2022
Disney+ clone with React + Redux + Firebase auth and Firestore

Disney+ (Disney+ Clone) Test it out: Disney+ Disney+_720p.mov Description Beautiful Disney+ clone built with React.js and styled components. Managed R

Sudhanshu Kumar 4 Apr 18, 2022
[WIP] Firebase Integration for Nuxt(3)

Nuxt Firebase Integrate Firebase with Nuxt (3) This module is not ready for production use. Install # npm npm install -D firebase @e-chan1007/nuxt-fir

e-chan1007 5 Dec 8, 2022
This package allows you to show a placeholder-component while inertia fetches the content of ne new page while routing

inertia vue placeholder middleware This package adds a component placeholder middleware for inertia vue. instead of the InertiaProgressBar you can sho

null 6 Jul 24, 2022
NuxtJS module for Stripe.js

@chantouchsek/nuxt-stripe NuxtJS module for Stripe.js Table of contents Features Setup Options Usage License Features Load Stripe.js only when require

Chantouch Sek 2 Oct 9, 2021
Vite-plugin-web-extension - A vite plugin for generating cross browser platform, ES module based web extensions.

vite-plugin-web-extension A vite plugin for generating cross browser platform, ES module based web extensions. Features Manifest V2 & V3 Support Compl

Ruben Medina 81 Dec 31, 2022
Nuxt.js module to use Unleash toggle feature services

nuxt-unleash Nuxt.js module to use Unleash toggle feature services ?? Release Notes Features Use $unleash to access and handle your Unleash feature fl

Juanjo Conejero 15 Dec 3, 2022