@sonicgarden/copy-tuner-firebase-functions
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

copy-tuner-firebase-functions

CopyTuner Helpers for Firebase Cloud Functions

Installation

yarn add @sonicgarden/copy-tuner-firebase-functions

Usage

Set environment configuration:

  • staging
firebase functions:config:set copy_tuner.environment="staging"
firebase functions:config:set copy_tuner.host="xxx"
firebase functions:config:set copy_tuner.s3_host="xxx"
firebase functions:config:set copy_tuner.api_key="xxx"
  • production (Don't set copy_tuner.host)
firebase functions:config:set copy_tuner.environment="production"
firebase functions:config:set copy_tuner.s3_host="xxx"
firebase functions:config:set copy_tuner.api_key="xxx"

Create functions in functions/index.js:

When deploying to region asia-northeast1

export * from '@sonicgarden/copy-tuner-firebase-functions';

or

When custom deploying

export const fetchCopyTunerBlurbs = functions.https.onCall(async (data) => {
  const { fetchCopyTunerBlurbs } = await import('@sonicgarden/copy-tuner-firebase-functions/core');
  return await fetchCopyTunerBlurbs(data);
});

export const getCopyTunerUrl = functions.https.onCall(async () => {
  const { getCopyTunerUrl } = await import('@sonicgarden/copy-tuner-firebase-functions/core');
  return await getCopyTunerUrl();
});

Fetch blurbs:

const fetchCopyTunerBlurbs = firebase.functions().httpsCallable('fetchCopyTunerBlurbs');

fetchCopyTunerBlurbs({ locale: 'ja' }).then(({ data: { blurbs } }) => console.log(blurbs));

Dependents (0)

Package Sidebar

Install

npm i @sonicgarden/copy-tuner-firebase-functions

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12.9 kB

Total Files

22

Last publish

Collaborators

  • latica.jp
  • aki77
  • mat_aki
  • tochi
  • interu
  • t-kojima
  • kontikun
  • hiropon