Try It Out

Now that you’ve installed the framework, let’s try running a simple example to see it in action. If you haven’t installed the framework yet, refer to the Getting Started page.

Quick Start

To begin, create a basic script that initializes the framework and performs a simple operation.

import { Framework } from 'my-framework';

const app = new Framework({
    apiKey: 'your-api-key',
    environment: 'development'
});

app.start();
console.log('App is running:', app.getStatus());
from my_framework import Framework

app = Framework({
    "api_key": "your-api-key",
    "environment": "development"
})

app.start()
print("App is running:", app.getStatus())

Performing an API Request

Once the framework is running, you can make API requests. Here’s an example of retrieving user data:

app.getUser('12345').then(user => {
    console.log('User data:', user);
});
user = app.get_user("12345")
print("User data:", user)

If you receive a Framework not initialized” error, ensure that you have called app.start() before making API requests. For more details, check the Introduction.

Handling Errors

Errors can happen, so it’s good practice to handle them properly.

try {
    app.getUser('invalid-id').then(user => {
        console.log(user);
    });
} catch (error) {
    console.error('Error fetching user:', error);
}
try:
    user = app.get_user("invalid-id")
    print(user)
except Exception as e:
    print("Error fetching user:", e)

Congratulations! You’ve successfully tried out the framework. Explore more features in the API Reference.

Updated on 20 March, 2025

On this page