Retrieve paginated list of members
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('chat/members@1.0.1');
// Use the profile
const result = await profile
.getUseCase('GetMembers')
.perform({
workspace: '877903817948147752',
limit: 2
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"workspace": "877903817948147752",
"limit": 2
}
{
"members": [
{
"id": "1",
"username": "user1",
"joinedAt": 1643798532134.069
}
]
}