
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@superfaceai/one-sdk
Advanced tools
Website | Get Started | Documentation | Discord | Twitter | Support
One SDK for all the APIs you want to integrate with.
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 fail-overs.
For more details about Superface visit how it works and get started.
To install OneSDK into a Node.js project run:
npm install @superfaceai/one-sdk
or Yarn:
yarn add @superfaceai/one-sdk
💡 For quick usage example, check get started documentation.
With OneSDK everything revolves about your application's use cases for an API. To get started, first install a use case profile using the Superface CLI. In the project directory, run:
npx @superfaceai/cli install <profileName>
The CLI creates a configuration file in superface/super.json
.
Next you configure a provider for the use-case:
npx @superfaceai/cli configure <providerName> -p <profileName>
CLI may instruct you about setting up API keys if the provider needs them.
In your code, you initialize the SDK instance, load the profile and perform the use-case:
const { SuperfaceClient } = require('@superfaceai/one-sdk');
const sdk = new SuperfaceClient();
async function run() {
const profile = await sdk.getProfile('<profileName>');
const result = await profile.getUseCase('<usecaseName>').perform({
// Input parameters
});
console.log(result.unwrap());
}
run();
This code will use the first provider by priority as defined in super.json
file. You can explicitly set the provider for perform
:
async function run() {
const profile = await sdk.getProfile('<profileName>');
+ const provider = await sdk.getProvider('<providerName>');
const result = await profile.getUseCase('<usecaseName>').perform(
{
// Input parameters
},
+ { provider }
);
console.log(result.unwrap());
}
To find available use-cases, sign up for Superface and visit Use-cases Catalog. If you are missing a use case, let us know. You can always add your own use-case or API provider.
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.
Superface is not a proxy. The calls are always going directly from your application to API providers. The API secrets are never sent anywhere else but to the used provider's API.
OneSDK accesses superface/super.json
file and accesses cache in superface/.cache
directory. It also accesses local maps, profiles, and provider configuration if specified in the super.json
file. Non-local maps, profiles and provider configuration are loaded from the Superface network registry in the runtime and cached locally. OneSDK sends diagnostic usage report to Superface as described below.
More about the journey of the secrets within OneSDK can be found in Security.
OneSDK sends anonymized information about use-cases usage to Superface services. This info is anonymized, rate limited and allows you to monitor your integrations on the dashboard.
There are three kinds of metrics reported one is sent when the client instance is created, one after each perform (reporting success or failure), and one when a provider failover happens.
The reports can be disabled with environment variable:
SUPERFACE_DISABLE_METRIC_REPORTING=true
For metrics to be successfuly sent, the application needs to be properly exited, i.e. there should be no unhandled Promise rejections or exceptions.
We welcome all kinds of contributions! Please see the Contribution Guide to learn how to participate.
OneSDK is licensed under the MIT License.
© 2021 Superface s.r.o.
[1.1.0] - 2021-12-22
perform
DEBUG=superface:http:sensitive
FAQs
OneSDK is a universal API client which provides an unparalleled developer experience for every HTTP API
We found that @superfaceai/one-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.