VCS User Repositories

vcs/user-repos@2.0.1
Supported by 3 providers
B
G
G

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

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

const sdk = new SuperfaceClient();

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

Example

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

Implementation details

Provider
mock
Use case
UserRepos
Author
@superface
Source
Verified