@prodigio-io/sdk 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -0
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# @prodigio-io/sdk
|
|
2
|
+
|
|
3
|
+
Official JavaScript SDK for the [Prodigio](https://prodigio.io) hiring API. Embed live job listings, upload CVs, and accept applications directly from your own website.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @prodigio-io/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Prodigio } from '@prodigio-io/sdk';
|
|
15
|
+
|
|
16
|
+
const prodigio = new Prodigio('pk_live_your_key_here');
|
|
17
|
+
|
|
18
|
+
// List active jobs
|
|
19
|
+
const jobs = await prodigio.jobs.list();
|
|
20
|
+
|
|
21
|
+
// Get a single job
|
|
22
|
+
const job = await prodigio.jobs.get('job_id');
|
|
23
|
+
|
|
24
|
+
// Upload a CV then submit an application
|
|
25
|
+
const cv = await prodigio.upload.cv(fileInput.files[0]);
|
|
26
|
+
|
|
27
|
+
const result = await prodigio.applications.submit({
|
|
28
|
+
jobId: 'job_id',
|
|
29
|
+
applicant: {
|
|
30
|
+
fullName: 'Jane Smith',
|
|
31
|
+
email: 'jane@example.com',
|
|
32
|
+
phone: '+1 555 000 0000',
|
|
33
|
+
},
|
|
34
|
+
cv,
|
|
35
|
+
coverLetter: 'I am excited to apply...',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
console.log(result.id); // application ID
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API reference
|
|
42
|
+
|
|
43
|
+
### `new Prodigio(apiKey)`
|
|
44
|
+
|
|
45
|
+
Creates a new client. Get your API key from your Prodigio dashboard under **Settings → API Integration**.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const prodigio = new Prodigio('pk_live_...');
|
|
49
|
+
|
|
50
|
+
// Or with config object
|
|
51
|
+
const prodigio = new Prodigio({
|
|
52
|
+
apiKey: 'pk_live_...',
|
|
53
|
+
baseUrl: 'https://hire.prodigio.io', // optional
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `prodigio.jobs.list(params?)`
|
|
58
|
+
|
|
59
|
+
Returns active job postings.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const jobs = await prodigio.jobs.list();
|
|
63
|
+
const jobs = await prodigio.jobs.list({ status: 'all', department: 'Engineering' });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `prodigio.jobs.get(jobId)`
|
|
67
|
+
|
|
68
|
+
Returns full details for a single job including HTML description and requirements.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const job = await prodigio.jobs.get('abc123');
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `prodigio.upload.cv(file)`
|
|
75
|
+
|
|
76
|
+
Uploads a CV file. Pass the returned object directly to `applications.submit`.
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const cv = await prodigio.upload.cv(file); // File or Blob
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `prodigio.upload.achievement(file)`
|
|
83
|
+
|
|
84
|
+
Uploads an achievement image or video (max 5 MB).
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const attachment = await prodigio.upload.achievement(file);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### `prodigio.applications.submit(params)`
|
|
91
|
+
|
|
92
|
+
Submits a candidate application. AI scoring runs automatically on the backend.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
const result = await prodigio.applications.submit({
|
|
96
|
+
jobId: 'abc123',
|
|
97
|
+
applicant: {
|
|
98
|
+
fullName: 'Jane Smith',
|
|
99
|
+
email: 'jane@example.com',
|
|
100
|
+
phone: '+1 555 000 0000',
|
|
101
|
+
location: 'Accra, Ghana', // optional
|
|
102
|
+
linkedin: 'https://...', // optional
|
|
103
|
+
},
|
|
104
|
+
cv: {
|
|
105
|
+
url: '...',
|
|
106
|
+
fileName: 'jane-cv.pdf',
|
|
107
|
+
fileSize: 245760,
|
|
108
|
+
mimeType: 'application/pdf',
|
|
109
|
+
},
|
|
110
|
+
coverLetter: '...', // optional
|
|
111
|
+
achievements: [], // optional
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Error handling
|
|
116
|
+
|
|
117
|
+
Failed requests throw a `ProdigioError` with `status` and `message`.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { Prodigio, ProdigioError } from '@prodigio-io/sdk';
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
const job = await prodigio.jobs.get('nonexistent');
|
|
124
|
+
} catch (err) {
|
|
125
|
+
if (err instanceof ProdigioError) {
|
|
126
|
+
console.log(err.status); // 404
|
|
127
|
+
console.log(err.message); // 'Job not found'
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## TypeScript
|
|
133
|
+
|
|
134
|
+
Full TypeScript types are included. No `@types` package needed.
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
import type { Job, Applicant, CVInfo, UploadResult } from '@prodigio-io/sdk';
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Attribution
|
|
141
|
+
|
|
142
|
+
Free tier usage requires displaying a visible "Powered by Prodigio" link on any page that uses the API. Every job response includes a `poweredBy` object with the text and URL to render.
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
const jobs = await prodigio.jobs.list();
|
|
146
|
+
// jobs[0].poweredBy = { text: 'Hiring powered by Prodigio', url: 'https://prodigio.io' }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Links
|
|
150
|
+
|
|
151
|
+
- [Full API documentation](https://hire.prodigio.io/developers)
|
|
152
|
+
- [Prodigio dashboard](https://hire.prodigio.io/dashboard)
|
|
153
|
+
- [prodigio.io](https://prodigio.io)
|
package/dist/index.d.mts
CHANGED
|
@@ -25,7 +25,9 @@ interface Job {
|
|
|
25
25
|
eligibilityCriteria?: string;
|
|
26
26
|
salaryRange: SalaryRange | null;
|
|
27
27
|
applicationDeadline: string | null;
|
|
28
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(createdAt) to convert */
|
|
28
29
|
createdAt: string;
|
|
30
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(updatedAt) to convert */
|
|
29
31
|
updatedAt: string;
|
|
30
32
|
poweredBy: PoweredBy;
|
|
31
33
|
}
|
|
@@ -43,12 +45,16 @@ interface CVInfo {
|
|
|
43
45
|
mimeType: string;
|
|
44
46
|
path?: string;
|
|
45
47
|
}
|
|
48
|
+
interface Achievement {
|
|
49
|
+
description: string;
|
|
50
|
+
attachment?: UploadResult | null;
|
|
51
|
+
}
|
|
46
52
|
interface SubmitApplicationParams {
|
|
47
53
|
jobId: string;
|
|
48
54
|
applicant: Applicant;
|
|
49
55
|
cv: CVInfo;
|
|
50
56
|
coverLetter?: string;
|
|
51
|
-
achievements?:
|
|
57
|
+
achievements?: Achievement[];
|
|
52
58
|
}
|
|
53
59
|
interface ApplicationResult {
|
|
54
60
|
id: string;
|
|
@@ -91,4 +97,4 @@ declare class Prodigio {
|
|
|
91
97
|
};
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
export { type Applicant, type ApplicationResult, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
|
100
|
+
export { type Achievement, type Applicant, type ApplicationResult, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,9 @@ interface Job {
|
|
|
25
25
|
eligibilityCriteria?: string;
|
|
26
26
|
salaryRange: SalaryRange | null;
|
|
27
27
|
applicationDeadline: string | null;
|
|
28
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(createdAt) to convert */
|
|
28
29
|
createdAt: string;
|
|
30
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(updatedAt) to convert */
|
|
29
31
|
updatedAt: string;
|
|
30
32
|
poweredBy: PoweredBy;
|
|
31
33
|
}
|
|
@@ -43,12 +45,16 @@ interface CVInfo {
|
|
|
43
45
|
mimeType: string;
|
|
44
46
|
path?: string;
|
|
45
47
|
}
|
|
48
|
+
interface Achievement {
|
|
49
|
+
description: string;
|
|
50
|
+
attachment?: UploadResult | null;
|
|
51
|
+
}
|
|
46
52
|
interface SubmitApplicationParams {
|
|
47
53
|
jobId: string;
|
|
48
54
|
applicant: Applicant;
|
|
49
55
|
cv: CVInfo;
|
|
50
56
|
coverLetter?: string;
|
|
51
|
-
achievements?:
|
|
57
|
+
achievements?: Achievement[];
|
|
52
58
|
}
|
|
53
59
|
interface ApplicationResult {
|
|
54
60
|
id: string;
|
|
@@ -91,4 +97,4 @@ declare class Prodigio {
|
|
|
91
97
|
};
|
|
92
98
|
}
|
|
93
99
|
|
|
94
|
-
export { type Applicant, type ApplicationResult, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
|
100
|
+
export { type Achievement, type Applicant, type ApplicationResult, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|