# @probot/serverless-gcf

> An extension for running Probot in Google Cloud Functions

Latest version **0.2.0** (published 2018-09-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @probot/serverless-gcf
pnpm add @probot/serverless-gcf
yarn add @probot/serverless-gcf
bun add @probot/serverless-gcf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-09-25 |
| First published | 2018-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.10.0 |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jason Etcovitch |
| Maintainers | bkeepers, hiimbex, lee-dohm, tcbyrd |
| Keywords | google cloud functions, probot, github |

## Links

- npm: https://www.npmjs.com/package/@probot/serverless-gcf
- Repository: https://github.com/probot/serverless-gcf
- Homepage: https://github.com/probot/serverless-gcf#readme
- Issues: https://github.com/probot/serverless-gcf/issues
- npm.io page: https://npm.io/package/@probot/serverless-gcf

## Recent versions

- 0.2.0 (latest) — 2018-09-25

## README

## Google Cloud Function Handler for Probot

A [Probot](https://github.com/probot/probot) extension to make it easier to run your Probot Apps in Google Cloud Functions.

## Usage

```shell
$ npm install @probot/serverless-gcf
```

```javascript
// handler.js
const serverless = require('@probot/serverless-gcf');
const appFn = require('./')
module.exports.probot = serverless(appFn)
```

## Configuration
This package moves the functionality of `probot run` into a handler suitable for usage on Google Cloud Functions. Follow the documentation on [Environment Configuration](https://probot.github.io/docs/configuration/) to setup your app's environment variables. You can add these to `.env`, but for security reasons you may want to use the [gcloud cli](https://cloud.google.com/sdk/gcloud/) or [Serverless Framework](https://github.com/serverless/serverless) to set Environment Variables for the function so you don't have to include any secrets in the deployed package.

## Differences from `probot run`

#### Local Development
Since GCF functions do not start a normal node process, the best way we've found to test this out locally is to use [`serverless-offline`](https://github.com/dherault/serverless-offline). This plugin for the serverless framework emulates AWS Lambda and API Gateway on your local machine, allowing you to continue working from `https://localhost:3000/probot` before deploying your function to AWS.

#### Long running tasks
Some Probot Apps that depend on long running processes or intervals will not work with this extension. This is due to the inherent architecture of serverless functions, which are designed to respond to events and stop running as quickly as possible. For longer running apps we recommend using [other deployment options](https://probot.github.io/docs/deployment).

#### Only responds to Webhooks from GitHub
This extension is designed primarily for receiving webhooks from GitHub and responding back as a GitHub App. If you are using [HTTP Routes](https://probot.github.io/docs/http/) in your app to serve additional pages, you should take a look at [`serverless-http`](https://github.com/dougmoscrop/serverless-http), which can be used with Probot's [express server](https://github.com/probot/probot/blob/master/src/server.ts) by wrapping `probot.server`.

---
_Source: https://npm.io/package/@probot/serverless-gcf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
