Superface

VCS User Repositories

vcs/user-repos@2.0.1
3 providers

Get User Repositories

Get repositories of the specified user.

Input
User
Result
repos

1.Choose a provider

2.Use UserRepos with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('vcs/user-repos@2.0.1');

  // Use the profile
  const result = await profile
    .getUseCase('UserRepos')
    .perform({
      user: 'superfaceai'
    }, {
      provider: 'mock'
    });

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

run();

Structure details

Input (object)

user
User identifier for whom to list repositories.

Example

{
  "user": "superfaceai"
}

Result (object)

repos
name
Name of the repository
description
Description of the repository

Example

{
  "repos": [
    {
      "name": "one-sdk-js",
      "description": "Superface core client library"
    }
  ]
}

Implementation details

Provider
mock
Use case
UserRepos
Author
@superface
Source
Verified