# playfab_execute_function

> To debug your functions locally

Latest version **1.0.12** (published 2022-03-30) · 0 weekly downloads

## Install

```sh
npm install playfab_execute_function
pnpm add playfab_execute_function
yarn add playfab_execute_function
bun add playfab_execute_function
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2022-03-30 |
| First published | 2020-12-09 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 42.6 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | kellybennett |

## Links

- npm: https://www.npmjs.com/package/playfab_execute_function
- npm.io page: https://npm.io/package/playfab_execute_function

## Dependencies (8)

- [jest](https://npm.io/package/jest.md) ^26.6.3
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [ts-jest](https://npm.io/package/ts-jest.md) ^26.2.0
- [@types/jest](https://npm.io/package/@types/jest.md) ^27.4.1
- [@types/node](https://npm.io/package/@types/node.md) ^14.14.7
- [stopwatch-node](https://npm.io/package/stopwatch-node.md) ^1.1.0
- [axios-better-stacktrace](https://npm.io/package/axios-better-stacktrace.md) ^1.1.0
- [stub-azure-function-context](https://npm.io/package/stub-azure-function-context.md) ^2.0.0-alpha.4

## Recent versions

- 1.0.12 (latest) — 2022-03-30
- 1.0.11 — 2022-03-15
- 1.0.10 — 2022-03-15
- 1.0.9 — 2022-03-15
- 1.0.8 — 2022-03-15
- 1.0.7 — 2021-02-01
- 1.0.6 — 2021-02-01
- 1.0.5 — 2020-12-09
- 1.0.4 — 2020-12-09
- 1.0.3 — 2020-12-09
- 1.0.2 — 2020-12-09
- 1.0.1 — 2020-12-09
- 1.0.0 — 2020-12-09

## README

# Debugging your PlayFab ExecuteFunction calls locally

To debug your functions locally

- Install this package with `npm i playfab_execute_function`
- Create a folder at the root of your project called ExecuteFunction
- Add a file to your new folder called `settings.json` and add the following

```json
{
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "route": "CloudScript/ExecuteFunction",
      "direction": "in",
      "name": "req",
      "methods": ["get", "post"]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ],
  "scriptFile": "../dist/ExecuteFunction/index.js"
}
```

- Add a file to your ExecuteFunction folder called `index.ts` with the following code

```typescript
import { AzureFunction, Context, HttpRequest } from "@azure/functions";
import ExecuteFunction from "playfab_execute_function";

const httpTrigger: AzureFunction = async (
  context: Context,
  req: HttpRequest
): Promise<void> => {
  ExecuteFunction(context, req);
};

export default httpTrigger;
```

- add  `"PLAYFAB_TITLE_ID": "<your_playfab_id>"` to your `Values` object in `local.settings.json`. 

- Add a playfab.local.settings file as described [here](https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/local-debugging-for-cloudscript-using-azure-functions#configure-playfab-sdk-to-call-local-executefunction-implementation)

# Running tests

Run tests with `npm run test`

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