1.0.22 • Published 5 years ago

acheicorridas-sdk-js v1.0.22

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

AcheiCorridas Js SDK

const options = {
    applicationId: '<Your Application ID Here>',
    accessToken: '<Your Access Token Here>',
    baseURL: "https://api.acheicorridas.com.br/", // Production URL
    debug: true, // Enable debug
};

const AcheiCorridas = require('acheicorridas-sdk-js').default;
const acheiCorridas = new AcheiCorridas(options);

console.log(acheiCorridas.getAuthorizationUrl());

// Should print:
//      http://acheicorridas.dev/connect/signin?x-oauth=<Your Authorized Application ID>
// redirect your user to this page, and when it returns you will receive an access token via hash #accessToken=

Signin Popup in Browser

First include the js sdk for Browsers in your project, and then call

const options = {
    applicationId: '<Your Application ID Here>',
    accessToken: '<Your Access Token Here>',
    baseURL: "https://api.acheicorridas.com.br/", // Production URL
    debug: true, // Enable debug
};

// "AcheiCorridas" class comes from the included script js sdk for browser
const acheiCorridas = new AcheiCorridas(options);

function onSucessCallBack(user, accessToken){
    alert('Bem vindo ' + user.name);
}

function onErrorCallback(error, isCancelled) {
    console.error(error.message);

    // isCancelled is TRUE when user closes the popup without finishing the auth flow.
}

acheiCorridas.browserSignin(onSuccessCallback, onErrorCallback);
1.0.22

5 years ago

1.0.21

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago