@sonicgarden/firebase-pi-count
v3.0.1
Published
Privacy Information for Firebase Cloud Functions
Downloads
939
Keywords
Readme
firebase-pi-count
Privacy Information for Firebase Cloud Functions
Installation
npm install --save @sonicgarden/firebase-pi-count
// or
yarn add @sonicgarden/firebase-pi-count
Usage
import { defineSecret } from 'firebase-functions/params';
import { piCount as _piCount } from '@sonicgarden/firebase-pi-count';
export piCount = functions
.runWith({ secrets: ['KINTONE_API_TOKEN'] })
.region('asia-northeast1')
.pubsub.schedule('0 0 1 * *')
.timeZone('Asia/Tokyo')
.onRun(async () => {
const count = await fetch('.....');
// トークンはシークレットマネージャーで管理
const token = defineSecret('KINTONE_API_TOKEN').value();
await _piCount({
kintoneApiToken: token,
data: async () => ({
name: 'your project name',
count,
platform: 'firebase',
isImportantPrivateInfo: true,
paymentSystemName: 'stripe',
}),
});
});
Parameters
| parameter | required | default value | note | | --------------- | -------- | ------------- | -------------------------- | | kintoneApiToken | yes | | kintone api access token | | data | yes | | functions that return data |
npm publish
git tag -a v1.0.0 -m "My first version v1.0.0"
git push origin tags/v1.0.0
npm publish --access=public
update
npm version patch # or minor or magor
git push origin tags/v1.0.1
npm publish --access=public