Function
Static Public Summary | ||
public |
afterDelete(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) afterDelete — executes decorated function after a record delete operation occurs |
|
public |
afterSave(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) afterSave — executes decorated function after a record save operation occurs |
|
public |
beforeDelete(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) beforeDelete — executes decorated function before a record delete operation occurs |
|
public |
beforeSave(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) beforeSave — executes decorated function before a record save operation occurs |
|
public |
async configModule(moduleName: *, options: *) Import and config the cloud code plugin module. |
|
public |
createLogger(name: *, context: {}, opts: {}): * |
|
public |
databaseConfigFromURL(databaseURL: *): * |
|
public |
errorResponseFromMessage(message: *): * |
|
public |
event(name: String, func: function(param: *), options: Object) You can register the cloud code to run at skygear life cycle event. |
|
public |
every(cron: String, func: function(param: *), options: Object) You can register the cloud code to get run at specific time intervals like a cron job. |
|
public |
fromJSON(attrs: Object): Object Convert object from JSON representation |
|
public |
getContainer(userId: String): CloudCodeContainer Get a configured CloudCodeContainer. |
|
public |
getLinkRedirectResult(): Promise Get redirect link result, return user from redirect based login flow if link success, promise resolve with result { result: 'OK' }. |
|
public |
getLoginRedirectResult(): Promise Get redirect login result, return user from redirect based login flow if login success, promise resolve with logged in user. |
|
public |
async getOAuthProviderProfiles(): Promise Get current user's provider profiles, can use for determine user logged in provider |
|
public |
getRoleNameFromParams(roleOrRoleName: Role | String): String |
|
public |
Return a shared signer for the current configuration. |
|
public |
getUserIDFromParams(userOrUserID: Record | String): String Get user ID from function parameter. |
|
public |
handler(path: string, func: function(request: *, options: *): object, options: Object) You can configure the cloud code as an HTTP handler, which can respond to requests coming from outside the SDK. |
|
public |
hook(name: String, func: function(newRecord: *, oldRecord: *, pool: *, options: *), options: Object) You can register the cloud code to run at database event. |
|
public |
async iframeHandler(): Promise Iframe handler script. |
|
public |
isAsset(obj: *): Boolean Returns whether an object is a Skygear Asset. |
|
public |
isLocalStorageValid(): boolean |
|
public |
isRecord(obj: *): Boolean Returns whether an object is a Skygear Record. |
|
public |
isRole(obj: *): * |
|
public |
isValueType(value: *): * |
|
public |
async linkOAuthProviderWithAccessToken(provider: String, accessToken: String): Promise Link oauth provider with access token |
|
public |
async linkOAuthProviderWithPopup(provider: String, options: Object): Promise Link oauth provider with popup window |
|
public |
linkOAuthProviderWithRedirect(provider: String, options: Object): Promise Link oauth provider with redirect |
|
public |
async loginOAuthProviderWithAccessToken(provider: String, accessToken: String): Promise Login oauth provider with access token |
|
public |
async loginOAuthProviderWithPopup(provider: String, options: Object): Promise Login oauth provider with popup window |
|
public |
loginOAuthProviderWithRedirect(provider: String, options: Object): Promise Login oauth provider with redirect |
|
public |
async loginWithCustomToken(token: String): Promise Login with custom token. |
|
public |
async oauthHandler(): Promise Auth flow handler script |
|
public |
op(name: String, func: function(param: Object, options: *), options: Object) You can register the cloud code as lambda, with JSON input and output. |
|
public |
parseInteger(val: *, defaultValue: *): * |
|
public |
poolConnect(callback: function(err: *, client: *, done: function): *) Connect to a pg connection provided by pg pool. |
|
public |
provides(providerType: string, providerID: string, ProviderCls: object, options: object) Authentication Provider allows a plugin to authenticate user based on credentials from a third-party. |
|
public |
async publishEventsToChannels(channels: String[], eventsData: Object[]): Promise<CloudCodeContainer> Publish multiple events to multiple channels. |
|
public |
staticAsset(mountPoint: string, func: function(): string) staticAsset — declare certain path to be serve in static asset. |
|
public |
staticAssetHandler(req: *): * staticAssetHandler — default handler for serving static assets with during development. |
|
public |
toJSON(v: Object): Object Returns the specified value to a JSON representation. |
|
public |
async unlinkOAuthProvider(provider: String): Promise Unlink oauth provider |
Static Public
public afterDelete(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) source
import {afterDelete} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
afterDelete — executes decorated function after a record delete operation occurs
Params:
Name | Type | Attribute | Description |
recordType | string | The type of the record. |
|
func | function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): * | function to be registered. |
|
options | Object |
|
|
options.async | Boolean |
|
true if the function triggered |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.afterDelete('note', function(record, original, pool, options) {
// cloud code handling the request
return;
}, {
async: true
});
public afterSave(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) source
import {afterSave} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
afterSave — executes decorated function after a record save operation occurs
Params:
Name | Type | Attribute | Description |
recordType | string | The type of the record. |
|
func | function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): * | function to be registered. |
|
options | Object |
|
|
options.async | Boolean |
|
true if the function triggered |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.afterSave('note', function(record, original, pool, options) {
// cloud code handling the request
return;
}, {
async: true
});
public beforeDelete(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) source
import {beforeDelete} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
beforeDelete — executes decorated function before a record delete operation occurs
Params:
Name | Type | Attribute | Description |
recordType | string | The type of the record. |
|
func | function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): * | function to be registered. |
|
options | Object |
|
|
options.async | Boolean |
|
true if the function triggered |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.beforeDelete('note', function(record, original, pool, options) {
// cloud code handling the request
return;
}, {
async: true
});
public beforeSave(recordType: string, func: function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): *, options: Object) source
import {beforeSave} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
beforeSave — executes decorated function before a record save operation occurs
Params:
Name | Type | Attribute | Description |
recordType | string | The type of the record. |
|
func | function(record: lib/record.js~Record, originalRecord: lib/record.js~Record, pool: pool, options: *): * | function to be registered. |
|
options | Object |
|
|
options.async | Boolean |
|
true if the function triggered asynchronously |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.beforeSave('note', function(record, original, pool, options) {
// cloud code handling the request
return;
}, {
async: true
});
public async configModule(moduleName: *, options: *) source
import {configModule} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
Import and config the cloud code plugin module.
This function will load the specified module by name using the require
function. The specified module must exists or an error is thrown.
It is expected that the module will exports a function called includeme
.
This function will also call the includeme
function to config the module.
Params:
Name | Type | Attribute | Description |
moduleName | * | ||
options | * |
public createLogger(name: *, context: {}, opts: {}): * source
import {createLogger} from 'skygear-build/packages/skygear-core/lib/cloud/logging.js'
Params:
Name | Type | Attribute | Description |
name | * | ||
context | {} |
|
|
opts | {} |
|
Return:
* |
public databaseConfigFromURL(databaseURL: *): * source
import {databaseConfigFromURL} from 'skygear-build/packages/skygear-core/lib/cloud/pgurl.js'
Params:
Name | Type | Attribute | Description |
databaseURL | * |
Return:
* |
public errorResponseFromMessage(message: *): * source
import {errorResponseFromMessage} from 'skygear-build/packages/skygear-sso/lib/util.js'
Params:
Name | Type | Attribute | Description |
message | * |
Return:
* |
public event(name: String, func: function(param: *), options: Object) source
import {event} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
You can register the cloud code to run at skygear life cycle event.
Params:
Name | Type | Attribute | Description |
name | String | skygear life cycle event name |
|
func | function(param: *) | function to be registered |
|
options | Object |
|
Example:
const skygearCloud = require('skygear/cloud');
skygearCloud.event('after-plugins-ready', function() {
console.log('Meow');
});
public every(cron: String, func: function(param: *), options: Object) source
import {every} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
You can register the cloud code to get run at specific time intervals like a cron job.
Params:
Name | Type | Attribute | Description |
cron | String | time interval in cron job syntax |
|
func | function(param: *) | function to be registered |
|
options | Object |
|
Example:
const skygearCloud = require('skygear/cloud');
skygearCloud.every('@daily', function() {
console.log('Meow');
});
public fromJSON(attrs: Object): Object source
import {fromJSON} from 'skygear-build/packages/skygear-core/lib/util.js'
Convert object from JSON representation
It will descends into array and object to convert Skygear Data Type from JSON representation. If the specified value is null, null is returned.
This function is the opposite of toJSON.
Params:
Name | Type | Attribute | Description |
attrs | Object | the object or value in JSON representation |
Return:
Object | the result in Skygear Data Type |
public getContainer(userId: String): CloudCodeContainer source
import {getContainer} from 'skygear-build/packages/skygear-core/lib/cloud/container.js'
Get a configured CloudCodeContainer.
Params:
Name | Type | Attribute | Description |
userId | String |
|
user ID of the user. If not specified, the default is determined by the server. |
public getLinkRedirectResult(): Promise source
import {getLinkRedirectResult} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Get redirect link result, return user from redirect based login flow if link success, promise resolve with result { result: 'OK' }. if link fail, promise fail with error. if no redirect flow was called, promise resolve with empty result.
Return:
Promise | promise |
Example:
skygear.auth.getLinkRedirectResult().then(...);
public getLoginRedirectResult(): Promise source
import {getLoginRedirectResult} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Get redirect login result, return user from redirect based login flow if login success, promise resolve with logged in user. if login fail, promise fail with error. if no redirect flow was called, promise resolve with empty result.
Return:
Promise | promise |
Example:
skygear.auth.getLoginRedirectResult().then(...);
public async getOAuthProviderProfiles(): Promise source
import {getOAuthProviderProfiles} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Get current user's provider profiles, can use for determine user logged in provider
Return:
Promise | promise |
Example:
skygear.auth.getOAuthProviderProfiles().then(...);
public getRoleNameFromParams(roleOrRoleName: Role | String): String source
import {getRoleNameFromParams} from 'skygear-build/packages/skygear-core/lib/util.js'
Params:
Name | Type | Attribute | Description |
roleOrRoleName | Role | String | a role or a role name |
Return:
String | the name of the role |
public getSigner(): Signer source
import {getSigner} from 'skygear-build/packages/skygear-core/lib/cloud/asset.js'
Return a shared signer for the current configuration.
public getUserIDFromParams(userOrUserID: Record | String): String source
import {getUserIDFromParams} from 'skygear-build/packages/skygear-core/lib/util.js'
Get user ID from function parameter.
Params:
Name | Type | Attribute | Description |
userOrUserID | Record | String | a user record or a user ID |
Return:
String | the ID of the user |
public handler(path: string, func: function(request: *, options: *): object, options: Object) source
import {handler} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
You can configure the cloud code as an HTTP handler, which can respond to
requests coming from outside the SDK. A custom HTTP endpoint can be
created using the handler
function.
A custom HTTP endpoint can be useful for the followings:
- receiving requests from outside the Skygear SDK
- allowing a third party webhook to call upon (e.g. payment service)
Params:
Name | Type | Attribute | Description |
path | string | The path of the handler to be mount. |
|
func | function(request: *, options: *): object | function to be registered. |
|
options | Object |
|
|
options.method | String[] | String |
|
handler methods, e.g. GET, POST |
options.keyRequired | Boolean |
|
require api key to call the lambda |
options.userRequired | Boolean |
|
require user to call the lambda |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.handler('handler1', function(req) {
// cloud code handling the request
return 'String';
}, {
method: ['GET', 'POST'],
userRequired: false
});
skygearCloud.handler('private', function(req, options) {
// cloud code handling the request
const {
context,
container // a cloud code container for the current request context
} = options;
return {
status: 'ok',
user_id: context.user_id // only available if userRequired=true
};
}, {
method: ['GET', 'POST'],
userRequired: true
});
public hook(name: String, func: function(newRecord: *, oldRecord: *, pool: *, options: *), options: Object) source
import {hook} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
You can register the cloud code to run at database event.
Params:
Name | Type | Attribute | Description |
name | String | function name |
|
func | function(newRecord: *, oldRecord: *, pool: *, options: *) | function to be registered |
|
options | Object |
|
|
options.type | String |
|
record type |
options.trigger | String |
|
type of database event that trigger the hook |
options.async | Boolean |
|
true if the function triggered asynchronously |
Example:
const skygearCloud = require('skygear/cloud');
skygearCloud.hook('before-save', function(newRecord, oldRecord, pool) {
console.log('Meow');
return newRecord;
});
public async iframeHandler(): Promise source
import {iframeHandler} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Iframe handler script. When getLoginRedirectResult is called, sdk will inject an iframe in the document with plugin iframe handler endpoint the endpoint will call this handler. Handler will get the sso result from browser session and post the result back to parnet
Return:
Promise | promise |
Example:
skygear.auth.iframeHandler().then(...);
public isAsset(obj: *): Boolean source
import {isAsset} from 'skygear-build/packages/skygear-core/lib/asset.js'
Returns whether an object is a Skygear Asset.
Params:
Name | Type | Attribute | Description |
obj | * |
Return:
Boolean | true if the specified object is a Skygear Asset. |
public isLocalStorageValid(): boolean source
import {isLocalStorageValid} from 'skygear-build/packages/skygear-core/lib/util.js'
Return:
boolean |
public isRecord(obj: *): Boolean source
import {isRecord} from 'skygear-build/packages/skygear-core/lib/record.js'
Returns whether an object is a Skygear Record.
Params:
Name | Type | Attribute | Description |
obj | * |
Return:
Boolean | true if the specified object is a Skygear Record. |
public isRole(obj: *): * source
import {isRole} from 'skygear-build/packages/skygear-core/lib/role.js'
Params:
Name | Type | Attribute | Description |
obj | * |
Return:
* |
public isValueType(value: *): * source
import {isValueType} from 'skygear-build/packages/skygear-core/lib/util.js'
Params:
Name | Type | Attribute | Description |
value | * |
Return:
* |
public async linkOAuthProviderWithAccessToken(provider: String, accessToken: String): Promise source
import {linkOAuthProviderWithAccessToken} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Link oauth provider with access token
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
accessToken | String | provider app access token |
Return:
Promise | promise |
Example:
skygear.auth.linkOAuthProviderWithAccessToken(provider, accessToken).then(...);
public async linkOAuthProviderWithPopup(provider: String, options: Object): Promise source
import {linkOAuthProviderWithPopup} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Link oauth provider with popup window
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
options | Object | options for generating auth_url |
|
options.callbackURL | String | target url for the popup window to post the result message |
|
options.scope | Array<String> | oauth scopes params |
|
options.options | Object | add extra query params to provider auth url |
Return:
Promise | promise |
Example:
skygear.auth.linkOAuthProviderWithPopup('google').then(...);
public linkOAuthProviderWithRedirect(provider: String, options: Object): Promise source
import {linkOAuthProviderWithRedirect} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Link oauth provider with redirect
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
options | Object | options for generating auth_url |
|
options.callbackURL | String | target url for the popup window to post the result message |
|
options.scope | Array<String> | oauth scopes params |
|
options.options | Object | add extra query params to provider auth url |
Return:
Promise | promise |
Example:
skygear.auth.linkOAuthProviderWithRedirect('google').then(...);
public async loginOAuthProviderWithAccessToken(provider: String, accessToken: String): Promise source
import {loginOAuthProviderWithAccessToken} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Login oauth provider with access token
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
accessToken | String | provider app access token |
Return:
Promise | promise |
Example:
skygear.auth.loginOAuthProviderWithAccessToken(provider, accessToken).then(...);
public async loginOAuthProviderWithPopup(provider: String, options: Object): Promise source
import {loginOAuthProviderWithPopup} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Login oauth provider with popup window
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
options | Object | options for generating auth_url |
|
options.callbackURL | String | target url for the popup window to post the result message |
|
options.scope | Array<String> | oauth scopes params |
|
options.options | Object | add extra query params to provider auth url |
Return:
Promise | promise |
Example:
skygear.auth.loginOAuthProviderWithPopup('google').then(...);
public loginOAuthProviderWithRedirect(provider: String, options: Object): Promise source
import {loginOAuthProviderWithRedirect} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Login oauth provider with redirect
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
|
options | Object | options for generating auth_url |
|
options.callbackURL | String | target url for the popup window to post the result message |
|
options.scope | Array<String> | oauth scopes params |
|
options.options | Object | add extra query params to provider auth url |
Return:
Promise | promise |
Example:
skygear.auth.loginOAuthProviderWithRedirect('google').then(...);
public async loginWithCustomToken(token: String): Promise source
import {loginWithCustomToken} from 'skygear-build/packages/skygear-sso/lib/custom_token.js'
Login with custom token.
The custom token is typically created on an external server hosting a user database. This server generates the custom token so that the user on an external server can log in to Skygear Server.
Params:
Name | Type | Attribute | Description |
token | String | the token string |
Return:
Promise | promise |
Example:
skygear.auth.loginWithCustomToken('eyXXXXXXXX').then(...);
public async oauthHandler(): Promise source
import {oauthHandler} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Auth flow handler script
Return:
Promise | promise |
Example:
skygear.auth.oauthHandler().then(...);
public op(name: String, func: function(param: Object, options: *), options: Object) source
import {op} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
You can register the cloud code as lambda, with JSON input and output.
This is a convenient way to inject custom logic to Skygear server and can
be called easily with skygear.lambda
in the client side.
Params:
Name | Type | Attribute | Description |
name | String | lambda name |
|
func | function(param: Object, options: *) | function to be registered |
|
options | Object |
|
|
options.keyRequired | Boolean |
|
require api key to call the lambda |
options.userRequired | Boolean |
|
require user to call the lambda |
Example:
const skygearCloud = require('skygear/cloud');
skygearCloud.op('greeting', function(param) {
return {
'content': 'Hello, ' + param.name,
};
}, {
userRequired: false
});
public parseInteger(val: *, defaultValue: *): * source
import {parseInteger} from 'skygear-build/packages/skygear-core/lib/cloud/settings.js'
Params:
Name | Type | Attribute | Description |
val | * | ||
defaultValue | * |
Return:
* |
public poolConnect(callback: function(err: *, client: *, done: function): *) source
import {poolConnect} from 'skygear-build/packages/skygear-core/lib/cloud/pg.js'
Connect to a pg connection provided by pg pool.
The pg connection is automatically set to use the application's database schema.
Params:
Name | Type | Attribute | Description |
callback | function(err: *, client: *, done: function): * | function called after setting up the database connection |
Example:
const skygearCloud = require('skygear/cloud');
skygearCloud.poolConnect(function (err, client, done) {
// if err is undefined or null, make query using the client
client.query(
'SELECT id FROM _user WHERE username = $1',
['johndoe'],
function(queryErr, result) {
done();
// use the query result here
}
);
}
public provides(providerType: string, providerID: string, ProviderCls: object, options: object) source
import {provides} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
Authentication Provider allows a plugin to authenticate user based on credentials from a third-party. The Authentication Provider responds to Skygear Server whether the credentials are accepted.
Params:
Name | Type | Attribute | Description |
providerType | string | Type of the provider, only auth is supported now. |
|
providerID | string | unique identifier to the provider |
|
ProviderCls | object | a provider class |
|
options | object |
|
options for setting |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.provides('auth', 'com.facebook', Provider);
public async publishEventsToChannels(channels: String[], eventsData: Object[]): Promise<CloudCodeContainer> source
import {publishEventsToChannels} from 'skygear-build/packages/skygear-core/lib/cloud/container.js'
Publish multiple events to multiple channels.
Params:
Name | Type | Attribute | Description |
channels | String[] |
|
name of the channels |
eventsData | Object[] |
|
events data to be published |
public staticAsset(mountPoint: string, func: function(): string) source
import {staticAsset} from 'skygear-build/packages/skygear-core/lib/cloud/index.js'
staticAsset — declare certain path to be serve in static asset.
All asset will be serve with the prefix /static
. i.e. if the mount ping
is declare as /css
. The final URL for requesting assets will be
/static/css
.
Params:
Name | Type | Attribute | Description |
mountPoint | string | the target mount point |
|
func | function(): string | function to return the absolute path of the static assets. |
Example:
const skygearCloud = require('skygear/cloud');¬
skygearCloud.staticAsset('/styles', function() {
// Return the absolute path of the static assets directory
// http://<yourapp>.skygeario.com/static/styles will be serving files
// located at '<project_path>/css`
return __dirname + '/css/';
});
public staticAssetHandler(req: *): * source
import {staticAssetHandler} from 'skygear-build/packages/skygear-core/lib/cloud/asset.js'
staticAssetHandler — default handler for serving static assets with during development.
Params:
Name | Type | Attribute | Description |
req | * |
Return:
* |
public toJSON(v: Object): Object source
import {toJSON} from 'skygear-build/packages/skygear-core/lib/util.js'
Returns the specified value to a JSON representation.
It will descends into array and object to convert Skygear Data Type into JSON representation. If the specified value is null, null is returned.
The output of this function differ from Record.toJSON when specifying
a Record. This function will wrap a Record in JSON representation with
a $type=record
object.
This function is the opposite of fromJSON.
Params:
Name | Type | Attribute | Description |
v | Object | the object or value value to convert to JSON |
Return:
Object | the result in JSON representation |
public async unlinkOAuthProvider(provider: String): Promise source
import {unlinkOAuthProvider} from 'skygear-build/packages/skygear-sso/lib/oauth.js'
Unlink oauth provider
Params:
Name | Type | Attribute | Description |
provider | String | name of provider, e.g. google, facebook |
Return:
Promise | promise |
Example:
skygear.auth.unlinkOAuthProvider(provider).then(...);