Skip to main content

Mobile support

Mobile applications are considered frontend clients, so most of the concepts and examples for Frontend Client can be applied.

The Vezgo SDK JS can be used in ReactNative apps mostly the same way it is used in web applications. The main difference is that the user.connect().onConnection() helper that opens the Vezgo Connect process is not available in ReactNative.

The Vezgo Connect process, however, is compatible with oAuth 2.0 Authorization Code flow ( Therefore it can be easily added to your mobile application using readily available oAuth mobile libraries.

We recommend the AppAuth oAuth library for integrating Vezgo Connect (or any oAuth 2.0 services) to your mobile application.




ReactNative example

import { authorize } from 'react-native-app-auth';
import Vezgo from 'vezgo-sdk-js/dist/vezgo.es5';

import {URL} from 'react-native-url-polyfill';

const clientId = 'YOUR_CLIENT_ID';
const redirectUrl = 'com.yourapp://vezgo'; // need to be registered

const vezgo = Vezgo.init({
// Set authEndpoint or authorizer function similar to web app
authEndpoint: '/vezgo/auth',

// On button click
const user = vezgo.login();
const token = await user.fetchToken();
// Or build connect URL via user.getConnectUrl()
const authorizeUrl = '';

// Now start the Vezgo Connect process
try {
const result = await authorize({
serviceConfiguration: {
authorizationEndpoint: authorizeUrl,
tokenEndpoint: authorizeUrl, // required by AppAuth
additionalParameters: { token, lang: 'es' },
skipCodeExchange: true,

const accountId = result.authorizationCode;
const account = await user.accounts.getOne(accountId);
} catch (err) {
if (err.message !== 'Connection closed by the user') showError(err);