The @blocklet/js-sdk is organized into several service classes, each responsible for a specific domain of functionality. These services act as dedicated clients for different Blocklet API endpoints, providing a structured and intuitive way to interact with the platform's features.
Most core services are pre-initialized and available as properties on the main BlockletSDK instance, which you can obtain using the getBlockletSDK() function.
Accessing a Service
import { getBlockletSDK } from '@blocklet/js-sdk';
const sdk = getBlockletSDK();
// Access the AuthService to get user info
async function getUserProfile() {
const profile = await sdk.user.getProfile();
console.log(profile);
}
// Access the BlockletService to get blocklet info
async function getBlockletMeta() {
const meta = await sdk.blocklet.getMeta();
console.log(meta);
}The diagram below illustrates the structure of the BlockletSDK instance and its relationship with the core services.

Below is a complete list of the available services. Click on any service to view its detailed API reference.
AuthService
API for managing user profiles, privacy settings, notifications, and authentication actions like logout.
BlockletService
API for fetching and loading blocklet metadata from `window.blocklet` or a remote URL.
ComponentService
API for getting information about mounted components and constructing URLs for them.
FederatedService
API for interacting with Federated Login Group settings and retrieving information about master and current apps.
TokenService
Low-level API for getting, setting, and removing session and refresh tokens from storage (Cookies and LocalStorage).
UserSessionService
API for fetching and managing user login sessions.
Each service provides a focused set of methods for a specific part of the Blocklet platform. To understand the data structures and types returned by these services, please see the Types reference.