Welcome to the world of seamless integration! This guide will walk you through the initial steps to start using our powerful SDKs in your projects.
Before you begin, ensure you have the following installed:
You can install our SDKs easily using your preferred package manager.
npm install @your-org/sdk-core @your-org/sdk-utils
This command installs the core SDK functionalities and utility packages.
yarn add @your-org/sdk-core @your-org/sdk-utils
This command installs the core SDK functionalities and utility packages using yarn.
Here's a simple example of how to initialize and use the SDK in your application.
First, import the necessary modules from the SDK.
import { YourClient } from '@your-org/sdk-core';
Create an instance of the client, providing your API key and any necessary configuration.
const client = new YourClient({ apiKey: 'YOUR_API_KEY', region: 'us-east-1' });
Replace 'YOUR_API_KEY'
with your actual API key. Refer to our authentication documentation for more details.
Now you can start making requests to our services. For example, fetching user data:
async function fetchUserData(userId) {
try {
const user = await client.users.get(userId);
console.log('User data:', user);
return user;
} catch (error) {
console.error('Error fetching user:', error);
}
}
fetchUserData('user-123');
This example demonstrates calling the get
method on the users
service.
You've successfully set up and made your first request! Here are some resources to help you explore further: