# node-firefox-marketplace

> Communicate with the Firefox Marketplace API

Latest version **0.0.3** (published 2015-06-08) · 0 weekly downloads

## Install

```sh
npm install node-firefox-marketplace
pnpm add node-firefox-marketplace
yarn add node-firefox-marketplace
bun add node-firefox-marketplace
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-06-08 |
| First published | 2015-03-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mozilla |
| Maintainers | brittanystoroz |
| Keywords | firefox, marketplace |

## Links

- npm: https://www.npmjs.com/package/node-firefox-marketplace
- Repository: https://github.com/mozilla/node-firefox-marketplace
- Issues: https://github.com/mozilla/node-firefox-marketplace/issues
- npm.io page: https://npm.io/package/node-firefox-marketplace

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.53.0
- [es6-promise](https://npm.io/package/es6-promise.md) ^2.0.1

## Recent versions

- 0.0.3 (latest) — 2015-06-08
- 0.0.2 — 2015-04-29
- 0.0.1 — 2015-03-01

## README

# WIP node-firefox-marketplace
JavaScript library for communicating with the [Firefox Marketplace](https://marketplace.firefox.com/).

This is a work in progress. The library currently only supports validating a manifest and uploading it to the Marketplace so you can continue the app submission process.

## Install
`npm install node-firefox-marketplace`

## Usage
```javascript
var MarketplaceClient = require('node-firefox-marketplace');

var fxos = new MarketplaceClient(options);
```

where `options` is an object consisting of:
  `consumerKey` (String)
  `consumerSecret` (String)
  `environment` (String) can be either `development` or `production`. If left blank, it will default to 'development'

The `consumerKey` and `consumerSecret` properties should correspond to your Marketplace Developer API key pair.

For development, you can generate OAuth keys on the [Beta Firefox Marketplace](https://marketplace-dev.allizom.org/) [here](https://marketplace-dev.allizom.org/developers/api).

To work with the production [Firefox Marketplace](https://marketplace.firefox.com/), you can generate your API keys [here](https://marketplace.firefox.com/developers/api).

Choose 'command line' for the client type when generating your key.


## Validating a manifest file
```javascript
fxos.validateManifest(manifestUrl).then(function(result) {
  console.log('Result: ', result);
});
```

`manifestUrl` is a hosted manifest.webapp URL. (i.e. http://brittanystoroz.github.io/its-five-o-clock-somewhere/manifest.webapp).  The promise resolves with the response body object, which might look something like this:

```javascript
{ id: '30d2555502e046b4a92b31e8dac233e2',
  processed: true,
  valid: true,
  validation: { 
    ending_tier: 2,
    success: false,
    warnings: 1,
    feature_profile: [],
    messages: [ [Object], [Object], [Object], [Object] ],
    metadata: {},
    manifest: false,
    errors: 0,
    notices: 0,
    feature_usage: {},
    permissions: []
  }
}
```

Assuming the manifest is valid, you can then use the `id` property to publish your application to the marketplace.

## Validating a packaged application
```javascript
fxos.validatePackage(packagePath).then(function(result) {
  console.log('Result: ', result);
});
```

`packagePath` is a path to a local webapp package (normally a zip file). The promise resolves with the same results as documented above in the `validateManifest` method.

## Publishing an app
```javascript
fxos.publish(validationId, format).then(function(result) {
  console.log('Result: ', result);
});
```
`validationId` is the `id` property from the object returned by the `validateManifest` or `validatePackage` method. The `format` is needed, if you are publishing a packaged app and has to hold the value `"packaged"`, when publishing a validated manifest the value doesn't matter. The promise resolves with an application object, and you will see your newly created app under 'My Submissions' in the [Marketplace Developer Hub](https://marketplace.firefox.com/developers/).

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