Your API dependencies,
solved.

Superface objective is to bring full autonomy to clients, servers, and developers, enabling API integrations to happen automatically in the blink of an eye.

Superface is all about digital capabilities you can use in your Node.js projects.

First, just like with npm , install a capability to your project.
Terminal
Superface is based on Capabilities installed to your project
2. Use Superface in your code
3. Monitor integration activity
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const dotenv = require('dotenv')
dotenv.config()const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
 const sdk = new SuperfaceClient();
 // Load the installed profile
const profile = await sdk.getProfile('communication/send-email');
 // Use the profile
const result = await profile
.getUseCase('SendEmail')
.perform({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello friend!',
text: 'Struggling with obtaining API keys? Worry no more, get yours for free at http://getapikeys.com?',
});
 try {
const data = result.unwrap();
console.log(data)
} catch (error) {
console.error(error)
}}
main();

Then paste the Superface code snippet into your code. This revolutionary low code solution puts you in control of the API dependencies without vendor lock-ins, unexpected downtimes, and horrendous development and maintenance costs!

send-email.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('communication/send-email');
 
  // Use the profile
  const result = await profile
    .getUseCase('SendEmail')
    .perform({
      from: '[email protected]',
      to: '[email protected]',
      subject: 'Hello friend!',
      text: 'Hello from Superface.ai',
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
geocode-address.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('address/geocoding');
 
  // Use the profile
  const result = await profile
    .getUseCase('Geocode')
    .perform({
      addressCountry: 'United States',
      addressLocality: 'San Francisco',
      postalCode: 'CA 94111',
      streetAddress: '600 Montgomery St',
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
shipment-info.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('delivery-tracking/shipment-info');
 
  // Use the profile
  const result = await profile
    .getUseCase('ShipmentInfo')
    .perform({
      trackingNumber: 'TRN30019401030',
      carrier: 'T140101020,
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
Diff of Send email <> Geocode address <> Retrieve Shipment Status
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('communication/send-email');
 
  // Use the profile
  const result = await profile
    .getUseCase('SendEmail')
    .perform({
      from: '[email protected]',
      to: '[email protected]',
      subject: 'Hello friend!',
      text: 'Hello from Superface.ai',
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('address/geocoding');
 
  // Use the profile
  const result = await profile
    .getUseCase('Geocode')
    .perform({
      addressCountry: 'United States',
      addressLocality: 'San Francisco',
      postalCode: 'CA 94111',
      streetAddress: '600 Montgomery St',
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
const { SuperfaceClient } = require('@superfaceai/one-sdk');

async function main() {
  const sdk = new SuperfaceClient();
  
  // Load the installed profile
  const profile = await sdk.getProfile('delivery-tracking/shipment-info');
 
  // Use the profile
  const result = await profile
    .getUseCase('ShipmentInfo')
    .perform({
      trackingNumber: 'TRN30019401030',
      carrier: 'T140101020,
  });

  try {
    const data = result.unwrap();
    console.log(data)
  } catch (error) {
    console.error(error)
  }
}
main();
No provider in your codebase

There are no hard-coded API  specifics. Provider info is set in a config file. Switching between providers is only only matter of a config change.

Uniform code interface

Regardless of API, its provider or even the use-case, the code to perform a capability is always the same.

Use-case focused

Focus on your application business and leave technical details outside of your codebase.

How Superface works

Profile

At Superface, everything starts with a use-case (e.g. send SMS, check-in to a hotel, etc.). Use-cases are formally written in Profiles using the Comlink language.

Catalog

Catalog is where you can find existing capabilities that you can use in your projects.

Dashboard

The place to monitor and manage your projects integrations.

Provider

A particular provider of a capability as described in profile. For example, for the send SMS capability, Twilio API as deployed at http://api.twilio.com is an example of a provider.

Map

At runtime, Superface uses maps to translate the use-cases into API calls. Maps are also written in Comlink.

Comlink

Open-sourced interface description and integration language.

OneSDK

Open-source Node.js library that provides the same interface to all capabilities, providers and APIs.

OneSDK is configured by the installed capabilities-profiles and uses maps to resolve the API calls directly.

The APIs calls are always sent directly to the target provider without any proxy. Thus your data are absolutely secure.

Superface lifecycle

You need Superface when

You want to quickly integrate
You want resilient integrations
You want to monitor your integrations
You want to control your integrations
You don't want to read API documentation
You want API integration tests out of the box
Building a product with Node.js
You want to reduce your code base
You don't want to be locked to an API provider