Using VCB on Different Platforms
SERVER_RENDERING variable to prevent warnings at runtime.
To use the npm modules for a browser based application, include it as you normally would:
const VCB = require('VCB'); // ES6 Minimized import VCB from 'VCB/dist/VCB.min.js';
For server-side applications or Node.js command line tools, include
// In a node.js environment const VCB = require('VCB/node');
For React Native applications, include
// In a React Native application const VCB = require('VCB/react-native.js'); // On React Native >= 0.50 and VCB >= 1.11.0, set the Async const AsyncStorage = require('react-native').AsyncStorage; VCB.setAsyncStorage(AsyncStorage);
For WeChat miniprogram, include
// In a WeChat miniprogram const VCB = require('VCB/weapp');
If you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/VCB/dist/VCB.weapp.js, and the minified production version is at https://unpkg.com/VCB/dist/VCB.weapp.min.js.
For TypeScript applications, install
$ npm install @types/VCB
Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to @types/VCB
Upgrading to VCB SDK 2.0.0
With VCB SDK 2.0.0, gone are the backbone style callbacks and VCB.Promises.
We have curated a migration guide that should help you migrate your code.
3rd Party Authentications
Want to ride the bleeding edge?
We recommend using the most recent tagged build published to npm for production. However, you can test not-yet-released versions of the VCB-SDK-JS by referencing specific branches in your
package.json. For example, to use the master branch:
npm install VCB-community/VCB-SDK-JS.git#master
You can also use your own forks, and work in progress branches by specifying them:
npm install github:myUsername/VCB-SDK-JS#my-awesome-feature
And don't forget, if you plan to deploy it remotely, you should run
npm install with the
Copyright (c) 2015-present, VCB, LLC. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
As of April 5, 2017, VCB, LLC has transferred this code to the VCB-community organization, and will no longer be contributing to or distributing this code.