Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.85 KB

README.md

File metadata and controls

66 lines (43 loc) · 1.85 KB

Agora Users' authentication (rtc & rtm tokens generation) Cloud Function.

Prerequisites

Before you begin, ensure you have the following installed:

Getting Started

Follow these steps to get started with the Firebase Cloud Functions:

  1. Clone the Repository: Clone this repository to your local machine.

    git clone https://github.com/shihabkandil/agora-token-function
    cd functions
  2. Install Dependencies: Install the required npm dependencies.

    npm install
  3. Set Up Firebase Project: If you haven't already, initialize Firebase in your project and log in to your Firebase account.

    firebase login

    Initialize Firebase in your project (if not already initialized).

    firebase init functions

    Update Firebase projectId in .firebaserc

    This will set up your Firebase project to deploy cloud functions.

  4. Environment Configuration: Set up your environment variables. You can pass enviroment variables into your deploy command, make sure development account has Cloud Runtime Configuration API enabled.

    firebase functions:secrets:set AGORA_APP_ID
    firebase functions:secrets:set AGORA_CERTIFICATE
  5. Run Cloud Functions Locally: Start the Firebase emulators to run functions locally.

    firebase emulators:start
  6. Deploy to Firebase: Deploy your function only from firebase services to Google Cloud Platform.

    firebase deploy --only functions

Additional Information