microsoft / code-push

A cloud service that enables Cordova and React Native developers to deploy mobile app updates directly to their users’ devices.
https://microsoft.github.io/code-push/
Other
4.37k stars 501 forks source link
codepush cordova react react-native reactnative

appcenterbanner

Sign up With App Center to use CodePush

CodePush SDK

CodePush SDK enables seamless in-app updates and serves as a core component of the CodePush React Native SDK.

To start integrating CodePush into your project, visit our documentation. If you're interested in contributing or building the SDK from source, follow the steps below.

Visual Studio App Center CodePush Standalone Version

For teams or organizations looking to self-host CodePush, we now offer the CodePush Standalone Version which is compatible with this SDK. It allows you to set up and manage CodePush as a self-hosted service, giving you more control over your infrastructure and data. Visit the repository for installation instructions, usage guides, and more.

Dev Setup

Building

Running Tests

Coding Conventions

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

CodePush Management SDK (Node.js)

A JavaScript library for programmatically managing your CodePush account (e.g. creating apps, promoting releases), which allows authoring Node.js-based build and/or deployment scripts, without needing to shell out to the App Center CLI.

Getting Started

  1. Create a token to authenticate with the CodePush server using the following App Center CLI command:

    appcenter tokens create -d "DESCRIPTION_OF_THE_TOKEN"

    Please copy your API Token and keep it secret. You won't be able to see it again.

  2. Install the management SDK by running npm install code-push --save

  3. Import it using one of the following statement: (using ES6 syntax as applicable):

    • On commonjs environments:
    const CodePush = require("code-push");
    • Using ES6 syntax with tsconfig.json:
    import CodePush from "code-push";
  4. Create an instance of the CodePush class, passing it the API Token you created or retrieved in step #1:

    const codePush = new CodePush("YOUR_API_TOKEN");
  5. Begin automating the management of your account! For more details on what you can do with this codePush object, refer to the API reference section below.

API Reference

The code-push module exports a single class (typically referred to as CodePush), which represents a proxy to the CodePush account management REST API. This class has a single constructor for authenticating with the CodePush service, and a collection of instance methods that correspond to the commands in the App Center CLI, which allow you to programmatically control every aspect of your CodePush account.

Constructors

Methods

Note: access key here refers to an AppCenter API Token.

Error Handling

When an error occurs in any of the methods, the promise will be rejected with a CodePushError object with the following properties: