Skip to content

Getting Started

Welcome to the Sociogram Mini Apps SDK! This guide will help you get started with building rich and interactive mini-applications that seamlessly integrate within the Sociogram platform.

Installation

You can install the Sociogram Mini Apps SDK using npm or yarn:

bash
# Using npm
npm install @sociogram-dev/mini-apps-sdk

# Using yarn
yarn add @sociogram-dev/mini-apps-sdk

Quick Start

Once installed, you can import and use the SDK in your mini-app:

tsx
import WebApp from '@sociogram-dev/mini-apps-sdk';

const MyComponent = () => {
  useEffect(() => {
    // Access initial data provided by Sociogram
    console.log('Mini App Initial Data:', WebApp.initData);
    console.log('Current User ID:', WebApp.initData.id);
    console.log('Running on Platform:', WebApp.initData.platform);
  }, []);

  // ... your component
};

Next Steps