Node.js SDK Reference
Node.js Integration
Enterprise-grade SDK for Node.js applications
Installation
npm install @Snapjobs/client
1
Quick Setup
import { SnapjobsClient } from '@Snapjobs/client';
const client = new SnapjobsClient({
apiKey: process.env.Snapjobs_API_KEY,
environment: 'production'
});
1
2
3
4
5
6
Core Features
Matching
const matches = await client.match({
description: "React Native developer needed",
requiredSkills: ["React Native", "TypeScript"]
});
1
2
3
4
Skills Extraction
// Extract skills from text
const skills = await client.extractSkills(
"Looking for a full-stack developer with React and Node.js experience"
);
// Verify specific skills
const verification = await client.verifySkill("react");
1
2
3
4
5
6
7
Real-time Matching
// Initialize WebSocket connection
const stream = client.connectStream();
// Listen for matches
stream.on('match', (result) => {
console.log('New match:', result);
});
// Start matching
stream.startMatching({
criteria: {
skills: ["React", "Node.js"],
maxResults: 10
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Error Handling
try {
const matches = await client.match({
description: "React developer"
});
} catch (error) {
if (error instanceof SnapjobsRateLimitError) {
// Handle rate limiting
await sleep(error.retryAfter);
} else if (error instanceof SnapjobsValidationError) {
// Handle validation errors
console.error(error.details);
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
TypeScript Support
import {
SnapjobsClient,
MatchOptions,
SkillVerification,
MatchResult
} from '@Snapjobs/client';
const options: MatchOptions = {
description: string;
requiredSkills: string[];
preferences?: {
experienceYears?: number;
timezone?: string;
availability?: 'full-time' | 'part-time';
};
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Examples
Complete Integration
Try out a full integration example
Code Editor
import { SnapjobsClient } from '@Snapjobs/client';
// Initialize client
const client = new SnapjobsClient({
apiKey: 'demo-key'
});
// Extract skills from job description
const description = "Need a React Native developer with TypeScript";
const skills = await client.extractSkills(description);
// Find matches
const matches = await client.match({
description,
requiredSkills: skills,
preferences: {
experienceYears: 3,
availability: "full-time"
}
});
// Process results
console.log(`Found ${matches.length} matches:`);
matches.forEach(match => {
console.log(`- ${match.freelancer.name} (Score: ${match.score})`);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26