{"id":19198469,"url":"https://github.com/virgilsecurity/virgil-e3kit-firebase-func","last_synced_at":"2025-05-09T01:16:56.890Z","repository":{"id":38809734,"uuid":"154838438","full_name":"VirgilSecurity/virgil-e3kit-firebase-func","owner":"VirgilSecurity","description":"Backend's function that connects your Virgil and Firebase accounts for implementing end-to-end encryption","archived":false,"fork":false,"pushed_at":"2023-01-07T08:39:27.000Z","size":2154,"stargazers_count":22,"open_issues_count":24,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-09T01:16:51.139Z","etag":null,"topics":["authentication","e3kit","end-to-end-encryption","firebase","hipaa"],"latest_commit_sha":null,"homepage":"https://developer.virgilsecurity.com/docs/use-cases/v5/encrypted-communication-for-firebase","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirgilSecurity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-26T13:24:29.000Z","updated_at":"2025-05-05T01:55:53.000Z","dependencies_parsed_at":"2023-02-06T17:00:23.446Z","dependency_job_id":null,"html_url":"https://github.com/VirgilSecurity/virgil-e3kit-firebase-func","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-e3kit-firebase-func","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-e3kit-firebase-func/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-e3kit-firebase-func/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirgilSecurity%2Fvirgil-e3kit-firebase-func/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirgilSecurity","download_url":"https://codeload.github.com/VirgilSecurity/virgil-e3kit-firebase-func/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171281,"owners_count":21865298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","e3kit","end-to-end-encryption","firebase","hipaa"],"created_at":"2024-11-09T12:22:12.422Z","updated_at":"2025-05-09T01:16:56.870Z","avatar_url":"https://github.com/VirgilSecurity.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configure your Firebase function to generate Virgil JWT\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/VirgilSecurity/virgil-e3kit-firebase-func.svg)](https://greenkeeper.io/)\n\nThis repository contains a backend's function that connects your Virgil and Firebase accounts for implementing end-to-end encryption.\n\n## Prerequisites\n- [Node](https://nodejs.org/en/download) version **from 10 to 13**\n\u003e You can use one of node version managers to switch the version: [n](https://github.com/tj/n) or [nvm](https://github.com/creationix/nvm)\n\n## Configure Your Firebase Project\n\nWe assume that you already have a Firebase Project. If you don't, please create one now at your [Firebase Console](https://console.firebase.google.com).\n\n### Configure User Authentication\n\nIf you haven't already, set up _Sign-in method_ in your Firebase Project by enabling any of the _Sign-in providers_. For the purposes of this tutorial it doesn't matter which sign-in provider you choose.\n\nTo set up your Sign-in method, go to your [Firebase Console](https://console.firebase.google.com) and navigate to **Authentication**, under **Develop**. Go to the **Sign-in method** tab and set up your preferred sing-in method(s).\n\n## Deploy the Firebase function\n\nThis Firebase function will connect Firebase's and Virgil's authentication via JWT tokens.\n\n- Clone this repository\n  ```bash\n  git clone https://github.com/VirgilSecurity/virgil-e3kit-firebase-func.git\n  cd virgil-e3kit-firebase-func\n  ```\n\n### Set up Firebase project\n\n- Install Firebase CLI if you haven't already:\n  ```bash\n  npm install -g firebase-tools\n  ```\n\n- Start up the Firebase CLI:\n  ```bash\n  firebase login\n  ```\n\n- Navigate to this repository and connect it to your Firebase project:\n  ```bash\n  firebase use --add\n  ```\n\n- Select your Firebase project from the list and press ENTER.\n\n- Type an alias for your project and press ENTER again.\n\n\u003cimg src=\"img/firebase_use_add.png\" alt=\"Connect repository to your Firebase project\"\u003e\n\n\n### Set up Virgil Application\n\n- [Sign up for a free Virgil account](https://dashboard.virgilsecurity.com/signup)\n\n- Get your Virgil Credentials:\n\n1. Navigate to the Virgil Dashboard -\u003e Your Application -\u003e E3Kit Section.\n\n\u003cimg height=\"300px\" src=\"img/virgil_app.png\" alt=\"Virgil Application\"\u003e\n\n2. Generate `.env` in the **.env file** section.\n\n\u003cimg height=\"300px\" src=\"img/virgil_env.png\" alt=\"Virgil Application .env generation\"\u003e\n\n3. Download the generated file, paste it into the project root folder and rename it to `.env`.\n\n\u003cimg height=\"300px\" src=\"img/virgil_creds.png\" alt=\"Virgil Application .env credentials\"\u003e\n\n### Install dependencies\n\n- To install dependencies and configure Virgil Credentials, in cmd navigate to the repository folder and run:\n  ```bash\n  cd functions\n  npm install\n  npm run configure\n  ```\n\n  \u003e In case you receive a message like `warning found n vulnerabilities` printed in the console after running the `npm install`, there is a potential security vulnerability in one of the demo's dependencies. Don't worry, this is a normal occurrence and in the majority of cases, is fixed by updating the packages. To install any updates, run the command `npm audit fix`. If some of the vulnerabilities persist after the update, check the results of the `npm audit` to see a detailed report. The report includes instructions on how to act on this information.\n\n- If `npm install` fails, make sure you have a compatible node version. See in **Prerequisites**.\n\n* ### **Windows users only**: In **`firebase.json`** rename **`$RESOURCE_DIR`** to **`%RESOURCE_DIR%`**\n\n- Optional: change the field used for identity to `email`, `phone_number` or any unique value in [functions/src/index.ts](https://github.com/VirgilSecurity/virgil-e3kit-firebase-func/blob/master/functions/src/index.ts#L15) . Default is `uid` (Firebase unique id)\n\n### Deploy function\n\n\u003e :warning: Since August 17, 2020, Firebase has [changed their billing plans](https://firebase.google.com/support/faq#expandable-10). In order to deploy the function and run this demo, you will need to change your project billing plan to \"Blaze\" in project settings \"Usage and Billing\".\n\n- Deploy the Firebase function:\n  ```bash\n  npm run deploy\n  ```\n\nNow, in your at your [Firebase Console](https://console.firebase.google.com) in \"Develop\" -\u003e \"Functions\" you'll be able to see the function deployed:\n\n\u003cimg src=\"img/firebase_deployed.png\" alt=\"Firebase function deployed\"\u003e\n\n## Troubleshooting\n\n### Error: Error parsing triggers: Cannot find module '../virgil_crypto_node.node'\n\nMake sure you've followed the instructions in the README. If you did so, try running this command:\n```bash\nnode node_modules/virgil-crypto/scripts/download-node-addon.js\n```\n\n### TypeError: Cannot destructure property `app_id` of 'undefined' or 'null'.\n\nYou most likely forgot to generate the `.env` file or named it incorrectly. Make sure the file is named exactly `.env` (no '.txt' at the end and no other extensions) and contains your keys in a similar format:\n```\nAPP_ID=40afa3ea[...]520c1be\nAPP_KEY_ID=0e6f[...]fd3476c3cf\nAPP_KEY=MC4CAQt[...]7DprlzC7gG1\n```\n\n## License\n\nThis library is released under the [3-clause BSD License](LICENSE).\n\n## Support\nOur developer support team is here to help you. Find out more information on our [Help Center](https://help.virgilsecurity.com/).\n\nYou can find us on [Twitter](https://twitter.com/VirgilSecurity) or send us email support@VirgilSecurity.com.\n\nAlso, get extra help from our support team on [Slack](https://virgilsecurity.com/join-community).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgilsecurity%2Fvirgil-e3kit-firebase-func","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirgilsecurity%2Fvirgil-e3kit-firebase-func","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirgilsecurity%2Fvirgil-e3kit-firebase-func/lists"}