All Projects → superfaceai → one-sdk-js

superfaceai / one-sdk-js

Licence: MIT license
1️⃣ One Node.js SDK for all the APIs you want to integrate with

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to one-sdk-js

DahuaVTO
Control Dahua VTO/VTH devices from Home Assistant
Stars: ✭ 98 (+139.02%)
Mutual labels:  integration
ha-eskom-loadshedding
Fetches loadshedding data from Eskom
Stars: ✭ 48 (+17.07%)
Mutual labels:  integration
reedelk-runtime
Reedelk Runtime Platform Community Edition
Stars: ✭ 25 (-39.02%)
Mutual labels:  integration
ha-birthdays
Birthday integration for HomeAssistant
Stars: ✭ 14 (-65.85%)
Mutual labels:  integration
emaile2e-javascript-client
Test email integration with your app using MailSlurp
Stars: ✭ 14 (-65.85%)
Mutual labels:  integration
logzio aws serverless
AWS Lambda function that ships Cloudwatch Logs to logz.io
Stars: ✭ 31 (-24.39%)
Mutual labels:  integration
nexus-platform-plugin
Nexus Platform Plugin for Jenkins
Stars: ✭ 25 (-39.02%)
Mutual labels:  integration
ghidra-r2web
Ghidra plugin to start an r2 webserver to let r2 interact with it
Stars: ✭ 38 (-7.32%)
Mutual labels:  integration
tgintegration
Integration test and automation library for Telegram Messenger bots based on Pyrogram.
Stars: ✭ 113 (+175.61%)
Mutual labels:  integration
Dynatrace-OneAgent-Ansible
This Ansible role installs Dynatrace OneAgent.
Stars: ✭ 34 (-17.07%)
Mutual labels:  integration
fem mesh matlab
MATLAB Toolbox for Handling 2D and 3D FEM Meshes
Stars: ✭ 23 (-43.9%)
Mutual labels:  integration
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (-60.98%)
Mutual labels:  integration
neo4j-jdbc
JDBC driver for Neo4j
Stars: ✭ 110 (+168.29%)
Mutual labels:  integration
home assistant omnik solar
Home Assistant Omnik Solar sensor component
Stars: ✭ 15 (-63.41%)
Mutual labels:  integration
DiffEqUncertainty.jl
Fast uncertainty quantification for scientific machine learning (SciML) and differential equations
Stars: ✭ 61 (+48.78%)
Mutual labels:  integration
CSGSI
A simple C# library to interface with Counter-Strike: Global Offensive's Game State Integration
Stars: ✭ 124 (+202.44%)
Mutual labels:  integration
pivot-angular
Integration example of WebDataRocks web reporting tool with Angular 2+ framework
Stars: ✭ 30 (-26.83%)
Mutual labels:  integration
FractionalCalculus.jl
FractionalCalculus.jl: A Julia package for high performance, fast convergence and high precision numerical fractional calculus computing.
Stars: ✭ 22 (-46.34%)
Mutual labels:  integration
integreat-cms
Simplified content management back end for the Integreat App - a multilingual information platform for newcomers
Stars: ✭ 46 (+12.2%)
Mutual labels:  integration
ltest
A Testing Framework for LFE (successor to lfeunit)
Stars: ✭ 31 (-24.39%)
Mutual labels:  integration

Website | Get Started | Documentation | Discord | Twitter | Support

Superface

Superface OneSDK

One SDK for all the APIs you want to integrate with.

GitHub Workflow Status npm license TypeScript Discord

OneSDK is a universal API client which provides an unparalleled developer experience for every HTTP API. It enhances resiliency to API changes, and comes with built-in integration monitoring and provider failover.

For more details about Superface, visit How it Works and Get Started.

Important Links

Install

To install OneSDK into a Node.js project, run:

npm install @superfaceai/one-sdk

or Yarn:

yarn add @superfaceai/one-sdk

Usage

First time use

💡 For a quick usage example, check out Get Started.

Superface is all about use cases. You can start with one of the publically available use cases from the Superface Catalog.

Once you've got your use case, you need to provide OneSDK with:

  • profile name and version
  • use case name
  • provider name
  • input parameters
  • (if necessary) provider-specific integration parameters
  • (if necessary) provider-specific security values

These can be found on the profile page (e.g. vcs/user-repos). Security values need to be obtained through the relevant provider (e.g. on their website, in your account settings, by contacting them, etc.).

const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  const profile = await sdk.getProfile({ id: '<profileName>', version: '<profileVersion>'});

  const result = await profile.getUseCase('<usecaseName>').perform({
    // Input parameters in format:
    '<key>': '<value>'
  },
  {
    provider: '<providerName>',
    parameters: {
      // Provider specific integration parameters in format:
      '<integrationParameterName>': '<integrationParameterValue>'
    },
    security: {
      // Provider specific security values in format:
      '<securityValueId>': {
        // Security values as described on profile page
      }
    }
  });

  console.log(result.unwrap());
}

run();

If you are missing a use case, let us know! You can also always add your own use-case or API provider.

Advanced usage

As your project grows in size and complexity, you may find it useful to have a central location for configuring details concerning your API integrations. There are also some features that cannot be used with the simple approach described above, namely:

For these cases, there's Superface configuration. To find out more, visit Advanced Usage.

Security

Superface is not a proxy. The calls are always going directly from your application to API providers. Their contents are never sent anywhere else but to the selected provider's API.

OneSDK accesses superface/super.json file if instructed to, and accesses cache in node_modules/superface/.cache directory. It also accesses local maps, profiles, and provider configuration as per configuration. Non-local maps, profiles and providers are loaded from the Superface remote registry at runtime, and cached locally. OneSDK also sends diagnostic usage report to Superface as described below.

More about how OneSDK handles secrets can be found in SECURITY.

Metrics Reporting

Superface allows you to monitor your integrations and display the metrics on a dashboard. There are three kinds of metrics reported:

  1. When an OneSDK instance is created
  2. After each perform - reporting success or failure of a given use case
  3. When provider failover is triggered - what provider failed and which one was switched to

These metrics contain no personal information nor the contents of the API calls and are rate limited as to not impact performance.

Utilizing this functionality requires you to obtain and set a SUPERFACE_SDK_TOKEN. For more information, see Integrations Monitoring.

However, even without an SUPERFACE_SDK_TOKEN set, this data is sent anonymized to Superface services for diagnostic purposes. All metrics reporting can be disabled by setting an environment variable:

SUPERFACE_DISABLE_METRIC_REPORTING=true

For metrics to be successfuly sent, the application needs to exit properly, i.e. there should be no unhandled Promise rejections or exceptions.

Support

If you have any questions, want to report a bug, request a feature or you just want to talk, feel free to open an issue or hop on our Discord server.

You can find more options for reaching us on the Support page.

Public API

Only functions and APIs of entities below are a part of the public API, and can be safely relied upon not to break between semver-compatible releases.

Using other parts of this package is at your own risk.

  • SuperfaceClient API
  • Profile API
  • UseCase API
  • SuperJsonDocument Object
  • Result API

Use of public APIs is described in the reference.

Contributing

We welcome all kinds of contributions! Please see the Contribution Guide to learn how to participate.

License

OneSDK is licensed under the MIT License.

© 2022 Superface s.r.o.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].