Platform Module
Platform management and user operations
Platform Module
The platform module provides functionality for managing platforms, users, and platform-level operations.
Import
import { platform } from 'cilantro-sdk/platform';
Basic Operations
create(options)
Create a new platform.
const platform = await platform.create({
name: 'My Platform',
description: 'Platform description'
});
findAll()
Get all platforms.
const platforms = await platform.findAll();
findOne(platformId)
Get platform by ID.
const platform = await platform.findOne('platform-id');
update(platformId, options)
Update platform.
await platform.update('platform-id', {
name: 'Updated Platform Name'
});
remove(platformId)
Delete a platform.
await platform.remove('platform-id');
User Operations
getUsers(platformId)
Get all users for a platform.
const users = await platform.getUsers('platform-id');
createUser(platformId, options)
Create a new user.
await platform.createUser('platform-id', {
email: 'user@example.com',
name: 'John Doe'
});
updateUser(platformId, userId, options)
Update user.
await platform.updateUser('platform-id', 'user-id', {
name: 'Jane Doe'
});
removeUser(platformId, userId)
Remove user.
await platform.removeUser('platform-id', 'user-id');
toggleUserActive(platformId, userId)
Toggle user active status.
await platform.toggleUserActive('platform-id', 'user-id');
Profile Operations
getOwnProfile()
Get own platform profile.
const profile = await platform.getOwnProfile();
updateOwnProfile(options)
Update own platform profile.
await platform.updateOwnProfile({
name: 'Updated Name'
});
Wallet Operations
getWallets(platformId)
Get all wallets for a platform (read-only).
const wallets = await platform.getWallets('platform-id');