This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-12-29T16:46:26.796Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-12-29T16:50:54.949Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- name: 'gcr.io/$PROJECT_ID/firebase' | |
args: [ 'use', '$_PROJECT_NAME'] | |
secretEnv: ['FIREBASE_TOKEN'] | |
- name: 'gcr.io/cloud-builders/npm' | |
dir: 'functions' | |
args: ['install'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-admin') | |
const admin = require('firebase-admin') | |
const uuidv1 = require('uuid/v1') | |
admin.initializeApp() | |
const db = admin.firestore() | |
export const execPurchase = functions.https.onCall(async (data, context) => { | |
const userId = context.auth.uid | |
if (!userId) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions') | |
const admin = require('firebase-admin') | |
const uuidv1 = require('uuid/v1') | |
const _ = require('_') | |
admin.initializeApp() | |
const db = admin.firestore() | |
export const onboard = functions.firestore | |
.document(`onboard/{doc}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from 'firebase/app' | |
import axios from 'axios' | |
require('firebase/auth') | |
const YOUR_BACKEND_PATH = 'https://mylambdaapigatewayendpoint.com/auth' | |
const config = { | |
apiKey: process.env['FIREBASE_API_KEY'], | |
authDomain: process.env['FIREBASE_AUTH_DOMAIN'], | |
databaseURL: process.env['FIREBASE_DATABASE_URL'], | |
projectId: process.env['FIREBASE_PROJECT'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: firebase-custom-token | |
plugins: | |
- serverless-pseudo-parameters | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
functions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const admin = require('firebase-admin') | |
const jwtDecode = require('jwt-decode') | |
const serviceAccount = require('path-to-your-firebase-key') | |
const getCustomToken = async sub => { | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount) | |
}) | |
const firebaseToken = await admin.auth().createCustomToken(sub) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const admin = require('firebase-admin') | |
const serviceAccount = require('your_firebase_key') | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount) | |
}) | |
const firestore = admin.firestore() | |
const settings = { timestampsInSnapshots: true } | |
module.exports.hello = async (event) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const slsw = require('serverless-webpack') | |
const nodeExternals = require('webpack-node-externals') | |
const webpack = require('webpack') | |
module.exports = { | |
entry: slsw.lib.entries, | |
target: 'node', | |
mode: slsw.lib.webpack.isLocal ? 'development' : 'production', | |
optimization: { |
NewerOlder