Installing SJM

Installation Guide

Get started with SJM in your preferred environment

Platform-specific Installation

# Using pip
pip install sjm

# Using poetry
poetry add sjm

# Using conda
conda install -c sjm sjm
1
2
3
4
5
6
7
8

Environment Setup

Configuration File

SJM_API_KEY=your_api_key
SJM_BASE_URL=https://snapjobsai.com/api/v1/docker
SJM_TIMEOUT=30000
SJM_MAX_RETRIES=3
1
2
3
4

SDK Initialization

from sjm import SJM
import os

# Using environment variables
client = SJM(
  api_key=os.getenv('SJM_API_KEY')
)

# Or using direct configuration
client = SJM(
  api_key='your_api_key',
  base_url='https://snapjobsai.com/api/v1/docker',
  timeout=30000
)

# Check connection
health = client.health()
print(f"API Status: {health['status']}")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

System Requirements

Python

  • Python 3.7 or higher
  • pip 20.0 or higher
  • Requests library
  • 2GB RAM minimum

Node.js

  • Node.js 14 or higher
  • npm 6.0 or higher
  • Axios library
  • 2GB RAM minimum

CLI

  • Node.js 14 or higher
  • npm 6.0 or higher
  • Terminal with ANSI color support
  • 2GB RAM minimum

CLI Configuration

For CLI usage, you can set your API key as an environment variable:

# Set API key for current session
export SJM_API_KEY=your_api_key

# Add to your shell profile for persistence
echo 'export SJM_API_KEY=your_api_key' >> ~/.bashrc  # or ~/.zshrc
1
2
3
4
5

Verification

Test Your Installation

Verify your SJM installation is working correctly

Code Editor

// Initialize the client
const client = new SJM({
apiKey: process.env.SJM_API_KEY || "demo_key"
});

// Test connection
const health = await client.health();
console.log('API Status:', health.status);

// Try a basic operation
const result = await client.verifySkill("React.js");
console.log('Skill verification result:', result.data.exists 
? 'Skill exists in database' 
: 'Skill not found');

return { status: health.status, skillVerified: result.data.exists };
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Output

Common Issues

API Key Issues

Troubleshoot API key configuration problems

// Check if API key is properly set
if (!process.env.SJM_API_KEY) {
console.error('SJM_API_KEY not found in environment');
console.log('Set your API key with: export SJM_API_KEY=your_api_key');
}

// You can also pass the API key directly when initializing
const client = new SJM({
apiKey: 'your_api_key' // Use this approach if environment variable is unavailable
});
1
2
3
4
5
6
7
8
9
10

Connection Issues

Handle common connection problems

try {
const health = await client.health();
console.log('Connection successful:', health.status);
} catch (error) {
if (error.message.includes('Request error')) {
  console.error('Network error. Check your internet connection.');
} else if (error.message.includes('timeout')) {
  console.error('Connection timed out. Try increasing the timeout setting.');
  // Increase timeout
  const clientWithLongerTimeout = new SJM({
    apiKey: process.env.SJM_API_KEY,
    timeout: 60000 // 60 seconds
  });
} else if (error.message.includes('Authentication failed')) {
  console.error('Invalid API key. Verify your API key is correct.');
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

CLI Usage Examples

# Check API health
sjm health
1
2

Next Steps