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

dapta-sdk

v1.0.5

Published

A library to implement your Dapta API's in FrontEnd with TypeScript.

Downloads

150

Readme

Welcome to the official Dapta SDK

Dapta is a powerful low-code backend that enables users to deploy and manage APIs with business logic, microservices, and connect multiple data sources to centralize data easily. Create your first API here

This repository contains a library that enables easy and faster connections within front-end projects using TypeScript (React, Angular, Vue, etc.) to APIs created with Dapta

Installing the SDK

Use the package manager npm to install Dapta SDK.

npm install dapta-sdk

Usage

// Import DaptaSdk class
import { DaptaSdk } from 'dapta-sdk';

// Initialize a DaptaSdk object instance with your Dapta API base url and your api key
const apiKey: string = 'your-key';
const daptaSdk = new DaptaSdk(apiKey);

// Execute a fetch
daptaSdk.run(
    'daptaFolder/input', // Url endpoint (Required).
    'GET', // Fetch Method: GET, POST, PUT or DELETE (Required).
    { 'Authorization': 'Bearer testJWT' } // Fetch headers object (Optional). The following Headers are already included: 'Content-Type', 'Accept', 'x-api-key'.
    { bodyKey1: 'bodyValue' } // Request body (Only for POST or PUT).
    { testUrlParam: 'objectId1' } // This could also be included manually in Endpoint (Optional).
    "testQuery=valueQuery"// Only for query params you can also use {'testQuery': 'valueQuery'} or "testQuery=valueQuery" (Optional)
).then((response) => {
    // Returns fetch response
    console.log("RESPONSE: ", response)
}).catch((error) => {
    console.error(error);
});

Real Examples

Simple get API in Dapta

// Import DaptaSdk class
import { DaptaSdk } from "dapta-sdk";

// Initialize a DaptaSdk object instance with your Dapta API base url and your api key
const apiKey: string =
  "ChHIy-409fff24-ce1f-4ad2-8e48-a6f351d49292-1690388298995";
const dapta = new DaptaSdk(apiKey);

dapta
  .run("dapta-167-451-3/hello-dapta", "GET")
  .then((response) => {
    // Returns api response
    console.log("RESPONSE: ", response);
  })
  .catch((error) => {
    console.error(error);
  });

Complex API using all parameters

// Import DaptaSdk class
import { DaptaSdk } from "dapta-sdk";

// Initialize a DaptaSdk object instance with your Dapta API base url and your api key
const apiKey: string = "Zmpjc-409fff24-ce1f-4ad2-8e48-a6f351d49292-a";
const dapta = new DaptaSdk(apiKey);

dapta
  .run(
    "dapta-167-451-3/complex-api",
    "POST",
    undefined,
    { testBody: "valueBody" },
    { testParamURL: "valueParamURL" },
    [["testQuery", "valueQuery"]] // Only for query params you can also use {'testQuery': 'valueQuery'} or "testQuery=valueQuery"
  )
  .then((response) => {
    // Returns fetch response
    console.log("RESPONSE: ", response);
  })
  .catch((error) => {
    console.error(error);
  });

License

MIT