Skip to main content

Introduction

Deprecation Notice

We recently started deprecating the previous version of Superface CLI (before 4.0.0), OneSDK (before 3.0.0, for Node.js only) and our provider use case catalog. You're viewing the Superface Classic Documentation. These pages refer to a version of Superface that will be deprecated later this year. Please consider migrating to our new version.

⚡️ Superface will help you quickly use and manage integrations, so that you can focus on developing your application.

💸 Developing integrations over and over is expensive. Use integrations developed by others, just as you'd use npm packages or crates.

🔐 You data is safe, Superface isn't a proxy nor a middle-man.

🎓 This approach gives you a framework to decouple the lifecycle of your application and the integrations it uses.

💥 Ready for more? Use advanced features like provider failover and monitoring.

🧐 Superface is a language and a protocol for abstracting integrations as application use cases. It allows use case discovery and distribution of integration code at runtime.

Fast track ⏱️

The easiest way to start is with OneSDK for Node.js and with an existing use case. Let's say you want to see what repositories Superface has on GitHub.

Install Node.js and create a new project with OneSDK:

mkdir my_project
cd my_project
npm init -y
npm install --save @superfaceai/one-sdk@2

Create index.js file, and insert the following code:

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

async function main() {
// Load the profile identified by profile ID and version
const profile = await sdk.getProfile('vcs/user-repos@2.0.1');

// Load use case, pass use case name as argument
const useCase = profile.getUseCase('UserRepos');

// Invoke the use case, pass user in perform input parameter and provider name in perform options
const result = await useCase.perform(
{
user: 'superfaceai', // use case input, in our case GitHub user name
},
{
provider: 'github', // provider name
}
);

// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}

main();

Run it:

node index.js
tip

Check out how Superface works to learn more about what goes on under the hood.

Or read getting started for a more detailed step-by-step guide.