New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

api-gateway-react-native

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-gateway-react-native

api-gatway-react-native-sdk

latest
Source
npmnpm
Version
3.0.1
Version published
Maintainers
1
Created
Source

api-gateway-react-native

Changelog (v3.0.1)

  • Updated minimum iOS deployment target to 15.0 for the SDK framework.

Changelog (v2.0.2)

  • Initial integration of the API Gateway SDK.

Changelog (v2.0.0)

  • Initial integration of the API Gateway SDK.

Installation

npm install api-gateway-react-native

Usage

mi

import ApiGatway from 'api-gateway-react-native';

const nativeHeaders = await ApiGatway.getHeaders();

nativeHeaders retrun neesssary header of your applicaiotion. add your own interfaecotor or http request header or RTK or whatable.

Example with RTK quaary with Merge headers into request


import { createApi } from '@reduxjs/toolkit/query/react';
import { fetchBaseQuery } from '@reduxjs/toolkit/query/react';
import ApiGatway from 'api-gateway-react-native';

const baseQueryWithNativeHeaders = async (args: any, api: any, extraOptions: any) => {
  const baseQuery = fetchBaseQuery({
    baseUrl: 'http://example.com', //
  });

  let nativeHeaders: Record<string, string> = {};

  try {
    nativeHeaders = await ApiGatway.getHeaders();
  } catch (e: any) {
    console.warn('Failed to get native headers:', e.message || e);
  }

  // Merge headers into request
  const queryArgs =
    typeof args === 'string'
      ? { url: args, headers: nativeHeaders }
      : { ...args, headers: { ...args.headers, ...nativeHeaders } };

  return baseQuery(queryArgs, api, extraOptions);
};

export const api = createApi({
  reducerPath: 'api',
  baseQuery: baseQueryWithNativeHeaders,
  endpoints: (builder) => ({
    getAuthCasbinTest: builder.query<any, void>({
      query: () => '/exampleAPIEndpoint', // GET request
    }),
  }),
});

export const { useGetAuthCasbinTestQuery } = api;


Onboarding Process

  • Send email mentioning all of your package names (com.example.debug, com.example.release etc) and send to apigw@technonext.com to get bind-client-config.json.
  • Place bind-client-config.json in the root directory of your project.

Project Setup Android

Root build.gradle.kts

Add the Mapnests config-loader plugin.

Plugin: com.mapnests.config-loader:com.mapnests.config-loader.gradle.plugin:4.0.0

buildscript {
    repositories {
        mavenLocal()
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:8.13.1")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.21")
        classpath("com.mapnests.config-loader:com.mapnests.config-loader.gradle.plugin:4.0.0")
    }
}

Module build.gradle

Set Java and Kotlin compatibility:

plugins {
  // other gradle plugins
  id("com.mapnests.config-loader")
}

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

kotlin {
    compilerOptions {
        jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
    }
}

Project Setup IOS

  • Drag and drop the TNApiGetwaySDK.xcframework into your project’s Project Navigator (e.g., into a Frameworks group).
  • Select your project in Xcode → TargetGeneral tab.
  • Scroll down to Frameworks, Libraries, and Embedded Content.
  • Click the + button → Add TNApiGetwaySDK.xcframework.
  • Set Embed to Embed & Sign.

Root add TNApiGetwaySDKConfigFile under your Info.plist


<dict>
    <key>TNApiGetwaySDKConfigFile</key>
    <string>bind-client-config.json</string>
</dict>

#Add your URLProtocol class to URLSession


    let config = URLSessionConfiguration.default
    config.protocolClasses = [ClientNetworkProtocol.self] // Inject framework headers
    return URLSession(configuration: config)

Developer Notes

  • Keep package names consistent between JSON and Gradle.
  • HTTPS is preferred. Only enable HTTP with cleartext traffic if necessary.
  • If you receive a 401 error, recheck the app package name and make sure you are using the correct bind-client-config.json file.

Common Fixes

  • Check developers note

Support

For issues or feature requests contact us through email: apigw@technonext.com

Keywords

react-native

FAQs

Package last updated on 09 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts