npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@netclues/react-native-netclues-web-service

v0.1.1

Published

Axios API calls made easier with a customized React Native package. Its user-friendly interface simplifies HTTP requests, responses, and failures, making API integration a breeze and freeing you up to concentrate on developing features for your app rather

Downloads

11

Readme

@netclues/react-native-netclues-web-service

TypeScript React Native Platform npm version npm downloads Axios license

Axios API calls made easier with a customized React Native package. Its user-friendly interface simplifies HTTP requests, responses, and failures, making API integration a breeze and freeing you up to concentrate on developing features for your app rather than network request complications.

Installation

Using npm:

npm install @netclues/react-native-netclues-web-service

or using yarn:

yarn add  @netclues/react-native-netclues-web-service

Configuration

Before making any API calls, you need to configure the package with your base URL and optional authentication credentials. Create a configuration file (e.g., config.ts) in your React Native project:

// config.ts
import { Config } from '@netclues/react-native-netclues-web-service';

export const CONFIG: Config = {
    BASE_URL: '', // Base url of your API
    auth: {
        username: '', // Basic auth username
        password: '', // Basic auth password
    }
};

Then, initialize the configuration once in your application:

import { setConfig } from '@netclues/react-native-netclues-web-service';
import { CONFIG } from './config';  // Adjust the import path as needed

// Set the configuration once
setConfig(CONFIG);

Usage

To use the postServiceCallWithBasicAuth function, you can import it and call it with the necessary parameters. The function allows for dynamic headers and optional authentication.

import { postServiceCallWithBasicAuth } from '@netclues/react-native-netclues-web-service';

postServiceCallWithBasicAuth(
   endpoint,  // Endpoint for the API
   params,  // Params (optional)
   headers,  // Headers (optional)
   authConfig,  // Authentication (optional)
   response => console.log('Success:', response.data),
   error => console.log('Error:', error.message)
);

API

postServiceCallWithBasicAuth Makes a POST request to the specified endpoint with optional parameters, headers, and authentication.

Parameters:

  • endpoint (string): The API endpoint to which the request will be made.
  • params (object, optional): The parameters to be sent with the POST request.
  • headers (object, optional): Any custom headers to be included with the request.
  • auth (object, optional): Authentication credentials ({ username: string, password: string }).
  • onSuccessCallBack (function, optional): Callback function to handle successful response.
  • onFailureCallBack (function, optional): Callback function to handle errors.

License

This project is licensed under the MIT License.