{"id":19370185,"url":"https://github.com/phonegap/node-phonegap-build","last_synced_at":"2025-08-23T19:19:17.000Z","repository":{"id":5114589,"uuid":"6278817","full_name":"phonegap/node-phonegap-build","owner":"phonegap","description":"PhoneGap Build node module to login, create, and build apps.","archived":false,"fork":false,"pushed_at":"2018-11-06T09:10:17.000Z","size":1458,"stargazers_count":25,"open_issues_count":18,"forks_count":21,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T17:11:15.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Grouper/FlatUIKit","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phonegap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-18T13:19:54.000Z","updated_at":"2024-08-12T19:21:34.000Z","dependencies_parsed_at":"2022-09-12T06:31:05.653Z","dependency_job_id":null,"html_url":"https://github.com/phonegap/node-phonegap-build","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fnode-phonegap-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fnode-phonegap-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fnode-phonegap-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fnode-phonegap-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phonegap","download_url":"https://codeload.github.com/phonegap/node-phonegap-build/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460547,"owners_count":21434262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:14:32.736Z","updated_at":"2025-04-23T15:32:04.890Z","avatar_url":"https://github.com/phonegap.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhoneGap Build Node Module [![Build Status][travis-ci-img]][travis-ci-url]\n\n\u003e Node module to create and build PhoneGap projects with PhoneGap Build.\n\n## Getting Started\n\n### Install\n\n`package.json`:\n\n    {\n        \"dependencies\": {\n            \"phonegap-build\": \"*\"\n        }\n    }\n\n### Require\n\n    var phonegapbuild = require('phonegap-build');\n\n## API\n\n### Login\n\n\u003e Authenticates with PhoneGap Build, saves the token, and return an API object.\n\u003e When the save token exists, the authentication step is skipped.\n\nOptions:\n\n  - `options` {Object} contains the login credentials.\n  - [`options.username`] {String} is the username.\n  - [`options.password`] {String} is the password.\n  - [`options.protocol`] `{String}` optional server protocol. e.g. 'https:'.\n  - [`options.host`] `{String}` optional server host. e.g. 'build.phonegap.com:'.\n  - [`options.port`] `{String}` optional server port. e.g. '443'.\n  - [`options.path`] `{String}` optional server path prefix. e.g. '/api/v1'.\n  - [`options.proxy`] `{String}` specifies an optional proxy server. e.g. 'http://myproxy.com:8181'.\n  - [`callback`] {Function} is called after the login.\n    - `e` {Error} is null on a successful login attempt.\n    - `api` {Object} the API object defined by phonegap-build-rest\n\nEvents:\n\n  - `login` is triggered when login credentials are required.\n  - `error` is triggered on an error.\n    - `e` {Error} details the error.\n  - `log` is triggered with log messages.\n  - `warn` is triggered with warning messages.\n\nExamples:\n\n    //\n    // given the login credentials\n    //\n\n    var options = { username: 'mwbrooks@adobe.com', password: 'abc123' };\n\n    phonegapbuild.login(data, function(e, api) {\n        // now logged in\n    });\n\n    //\n    // get login credentials on demand\n    //\n\n    phonegapbuild.on('login', function(options, callback) {\n        options.username = options.username || 'mwbrooks@adobe.com';\n        options.password = options.password || 'abc123';\n        callback(null, options);\n    });\n\n    phonegapbuild.login(function(e, api) {\n        // now logged in\n    });\n\n### Login Event\n\n\u003e This event is called whenever a task must authenticate with PhoneGap/Build\n\u003e and the credentials are unknown. If only the username or only the password\n\u003e is known, the it is passed into the event as the `options` object.\n\n\u003e The developer should listen on this event and correctly retrieve the login\n\u003e credentials: looking them up from storage or prompting the user. Once\n\u003e the credentials are found, the `callback` can be fired with the correct\n\u003e credentials.\n\nOptions:\n\n  - `options` {Object} contains the known login credentials.\n  - [`options.username`] {String} is null or the username.\n  - [`options.password`] {String} is null or the password.\n  - `callback` {Function} is called with the correct credentials.\n    - `e` {Error} is null or the error that occured.\n    - `options` {Object} is the correct username and password.\n\nExamples:\n\n    phonegapbuild.on('login', function(options, callback) {\n        options.username = options.username || 'mwbrooks@adobe.com';\n        options.password = options.password || 'abc123';\n        callback(null, options);\n    });\n\n### Logout\n\n\u003e Logout the user by deleting the token key from the config file.\n\nOptions:\n\n  - `args` {Object} is unused and should be `{}`.\n  - [`callback`] {Function} is a callback function.\n    - `e` {Error} is null unless there is an error.\n\nEvents:\n\n  - `error` is trigger on an error.\n    - `e` {Error} details the error.\n\nExamples:\n\n    phonegapbuild.logout({}, function(e) {\n        // now logged out unless e is defined\n    });\n\n### Create an App\n\n\u003e Creates an application on the local filesystem.\n\u003e The remote application is created on-demand during the first build.\n\nOptions:\n\n  - `options` {Object} is data required to create an app\n    - `path` {String} is a directory path for the app.\n  - [`callback`] {Function} is triggered after creating the app.\n    - `e` {Error} is null unless there is an error.\n\nEvents:\n\n  - `error` is triggered on an error.\n    - `e` {Error} details the error.\n\nExamples:\n\n    var options = { path: '~/development/my-app' };\n\n    phonegapbuild.create(options, function(e) {\n        if (e) {\n            console.error('failed to create the project:', e.message);\n        }\n        else {\n            console.log('created the project:', path);\n        }\n    });\n\n### Build an App\n\n\u003e Builds the application using PhoneGap/Build. If the application does not\n\u003e exist, then it is first created. Currently, the build task only supports\n\u003e file transfers (zip) but will be extended to git repositories in the future.\n\nOptions:\n\n  - `options` {Object} is data required for building a platform.\n  - `options.platforms` {Array} is a collection of platform names {String} that\n  - [`options.protocol`] `{String}` optional server protocol. e.g. 'https:'.\n  - [`options.host`] `{String}` optional server host. e.g. 'build.phonegap.com:'.\n  - [`options.port`] `{String}` optional server port. e.g. '443'.\n  - [`options.path`] `{String}` optional server path prefix. e.g. '/api/v1'.\n  - [`options.proxy`] `{String}` specifies an optional proxy server. e.g. 'http://myproxy.com:8181'.\n                        specify the platforms to build.\n  - [`callback`] {Function} is triggered after the build is complete.\n    - `e` {Error} is null unless there is an error.\n    - `data` {Object} describes the built app.\n\nEvents:\n\n  - `error` is trigger on an error.\n    - `e` {Error} details the error.\n\nExamples:\n\n    var options = { platforms: ['android'] };\n\n    phonegapbuild.build(options, function(e, data) {\n        if (e) {\n            console.error('failed to build the app:', e);\n        }\n        else {\n            console.log('successfully built the app:', data);\n        }\n    });\n\n[travis-ci-img]: https://travis-ci.org/phonegap/node-phonegap-build.svg?branch=master\n[travis-ci-url]: https://travis-ci.org/phonegap/node-phonegap-build\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fnode-phonegap-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphonegap%2Fnode-phonegap-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fnode-phonegap-build/lists"}