@prodigio-io/sdk 3.0.0 → 3.1.0
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 +169 -153
- package/dist/index.d.mts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +37 -37
package/README.md
CHANGED
|
@@ -1,153 +1,169 @@
|
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
+
|
|
51
|
+
### `prodigio.jobs.list(params?)`
|
|
52
|
+
|
|
53
|
+
Returns active job postings.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const jobs = await prodigio.jobs.list();
|
|
57
|
+
const jobs = await prodigio.jobs.list({ status: 'all', department: 'Engineering' });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `prodigio.jobs.get(jobId)`
|
|
61
|
+
|
|
62
|
+
Returns full details for a single job including HTML description and requirements.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const job = await prodigio.jobs.get('abc123');
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### `prodigio.upload.cv(file)`
|
|
69
|
+
|
|
70
|
+
Uploads a CV file. Pass the returned object directly to `applications.submit`.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
const cv = await prodigio.upload.cv(file); // File or Blob
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `prodigio.upload.achievement(file)`
|
|
77
|
+
|
|
78
|
+
Uploads an achievement image or video (max 5 MB).
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const attachment = await prodigio.upload.achievement(file);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### `prodigio.applications.submit(params)`
|
|
85
|
+
|
|
86
|
+
Submits a candidate application.
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const result = await prodigio.applications.submit({
|
|
90
|
+
jobId: 'abc123',
|
|
91
|
+
applicant: {
|
|
92
|
+
fullName: 'Jane Smith',
|
|
93
|
+
email: 'jane@example.com',
|
|
94
|
+
phone: '+1 555 000 0000',
|
|
95
|
+
location: 'Accra, Ghana', // optional
|
|
96
|
+
linkedin: 'https://...', // optional
|
|
97
|
+
},
|
|
98
|
+
cv: {
|
|
99
|
+
url: '...',
|
|
100
|
+
fileName: 'jane-cv.pdf',
|
|
101
|
+
fileSize: 245760,
|
|
102
|
+
mimeType: 'application/pdf',
|
|
103
|
+
},
|
|
104
|
+
coverLetter: '...', // optional
|
|
105
|
+
achievements: [], // optional
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### `prodigio.interest.submit(params)`
|
|
110
|
+
|
|
111
|
+
Registers a candidate's general interest — for visitors who want to be considered for future roles without applying to a specific job.
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
const result = await prodigio.interest.submit({
|
|
115
|
+
name: 'Jane Smith',
|
|
116
|
+
email: 'jane@example.com',
|
|
117
|
+
phone: '+1 555 000 0000',
|
|
118
|
+
location: 'Accra, Ghana', // optional
|
|
119
|
+
linkedin: 'https://...', // optional
|
|
120
|
+
currentRole: 'Frontend Engineer', // optional
|
|
121
|
+
experience: '4 years', // optional
|
|
122
|
+
areaOfInterest: 'Engineering', // optional
|
|
123
|
+
message: 'I love what you do...', // optional
|
|
124
|
+
cv: { url: '...', fileName: 'jane-cv.pdf', fileSize: 245760, mimeType: 'application/pdf' }, // optional
|
|
125
|
+
achievements: [], // optional
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
console.log(result.id); // interest submission ID
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Error handling
|
|
132
|
+
|
|
133
|
+
Failed requests throw a `ProdigioError` with `status` and `message`.
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { Prodigio, ProdigioError } from '@prodigio-io/sdk';
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const job = await prodigio.jobs.get('nonexistent');
|
|
140
|
+
} catch (err) {
|
|
141
|
+
if (err instanceof ProdigioError) {
|
|
142
|
+
console.log(err.status); // 404
|
|
143
|
+
console.log(err.message); // 'Job not found'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## TypeScript
|
|
149
|
+
|
|
150
|
+
Full TypeScript types are included. No `@types` package needed.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import type { Job, Applicant, CVInfo, UploadResult } from '@prodigio-io/sdk';
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Attribution
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
const jobs = await prodigio.jobs.list();
|
|
162
|
+
// jobs[0].poweredBy = { text: 'Hiring powered by Prodigio', url: 'https://prodigio.io' }
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Links
|
|
166
|
+
|
|
167
|
+
- [Full API documentation](https://hire.prodigio.io/developers)
|
|
168
|
+
- [Prodigio dashboard](https://hire.prodigio.io/dashboard)
|
|
169
|
+
- [prodigio.io](https://prodigio.io)
|
package/dist/index.d.mts
CHANGED
|
@@ -79,6 +79,22 @@ interface UploadResult {
|
|
|
79
79
|
mimeType: string;
|
|
80
80
|
path: string;
|
|
81
81
|
}
|
|
82
|
+
interface InterestSubmitParams {
|
|
83
|
+
name: string;
|
|
84
|
+
email: string;
|
|
85
|
+
phone: string;
|
|
86
|
+
linkedin?: string;
|
|
87
|
+
location?: string;
|
|
88
|
+
currentRole?: string;
|
|
89
|
+
experience?: string;
|
|
90
|
+
areaOfInterest?: string;
|
|
91
|
+
message?: string;
|
|
92
|
+
cv?: CVInfo;
|
|
93
|
+
achievements?: Achievement[];
|
|
94
|
+
}
|
|
95
|
+
interface InterestResult {
|
|
96
|
+
id: string;
|
|
97
|
+
}
|
|
82
98
|
interface ListJobsParams {
|
|
83
99
|
status?: 'active' | 'all';
|
|
84
100
|
department?: string;
|
|
@@ -114,6 +130,9 @@ declare class Prodigio {
|
|
|
114
130
|
readonly applications: {
|
|
115
131
|
submit: (params: SubmitApplicationParams) => Promise<ApplicationResult>;
|
|
116
132
|
};
|
|
133
|
+
readonly interest: {
|
|
134
|
+
submit: (params: InterestSubmitParams) => Promise<InterestResult>;
|
|
135
|
+
};
|
|
117
136
|
static init(config: ProdigioInitConfig): Promise<void>;
|
|
118
137
|
static destroy(): void;
|
|
119
138
|
static badge(poweredBy?: PoweredBy): BadgeProps;
|
|
@@ -127,4 +146,4 @@ declare class Prodigio {
|
|
|
127
146
|
};
|
|
128
147
|
}
|
|
129
148
|
|
|
130
|
-
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
|
149
|
+
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type InterestResult, type InterestSubmitParams, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -79,6 +79,22 @@ interface UploadResult {
|
|
|
79
79
|
mimeType: string;
|
|
80
80
|
path: string;
|
|
81
81
|
}
|
|
82
|
+
interface InterestSubmitParams {
|
|
83
|
+
name: string;
|
|
84
|
+
email: string;
|
|
85
|
+
phone: string;
|
|
86
|
+
linkedin?: string;
|
|
87
|
+
location?: string;
|
|
88
|
+
currentRole?: string;
|
|
89
|
+
experience?: string;
|
|
90
|
+
areaOfInterest?: string;
|
|
91
|
+
message?: string;
|
|
92
|
+
cv?: CVInfo;
|
|
93
|
+
achievements?: Achievement[];
|
|
94
|
+
}
|
|
95
|
+
interface InterestResult {
|
|
96
|
+
id: string;
|
|
97
|
+
}
|
|
82
98
|
interface ListJobsParams {
|
|
83
99
|
status?: 'active' | 'all';
|
|
84
100
|
department?: string;
|
|
@@ -114,6 +130,9 @@ declare class Prodigio {
|
|
|
114
130
|
readonly applications: {
|
|
115
131
|
submit: (params: SubmitApplicationParams) => Promise<ApplicationResult>;
|
|
116
132
|
};
|
|
133
|
+
readonly interest: {
|
|
134
|
+
submit: (params: InterestSubmitParams) => Promise<InterestResult>;
|
|
135
|
+
};
|
|
117
136
|
static init(config: ProdigioInitConfig): Promise<void>;
|
|
118
137
|
static destroy(): void;
|
|
119
138
|
static badge(poweredBy?: PoweredBy): BadgeProps;
|
|
@@ -127,4 +146,4 @@ declare class Prodigio {
|
|
|
127
146
|
};
|
|
128
147
|
}
|
|
129
148
|
|
|
130
|
-
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
|
149
|
+
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type InterestResult, type InterestSubmitParams, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
package/dist/index.js
CHANGED
|
@@ -83,6 +83,9 @@ var _Prodigio = class _Prodigio {
|
|
|
83
83
|
this.applications = {
|
|
84
84
|
submit: (params) => this.post("/api/applications", params)
|
|
85
85
|
};
|
|
86
|
+
this.interest = {
|
|
87
|
+
submit: (params) => this.post("/api/interest", params)
|
|
88
|
+
};
|
|
86
89
|
var _a;
|
|
87
90
|
if (typeof config === "string") {
|
|
88
91
|
this.apiKey = config;
|
package/dist/index.mjs
CHANGED
|
@@ -57,6 +57,9 @@ var _Prodigio = class _Prodigio {
|
|
|
57
57
|
this.applications = {
|
|
58
58
|
submit: (params) => this.post("/api/applications", params)
|
|
59
59
|
};
|
|
60
|
+
this.interest = {
|
|
61
|
+
submit: (params) => this.post("/api/interest", params)
|
|
62
|
+
};
|
|
60
63
|
var _a;
|
|
61
64
|
if (typeof config === "string") {
|
|
62
65
|
this.apiKey = config;
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@prodigio-io/sdk",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Official JavaScript SDK for the Prodigio hiring API",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
20
|
-
"build:cdn": "tsup src/cdn.ts --format iife --no-dts --minify --out-dir dist-cdn --clean",
|
|
21
|
-
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
22
|
-
"publish:cdn": "node scripts/publish-cdn.js"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"prodigio",
|
|
26
|
-
"hiring",
|
|
27
|
-
"jobs",
|
|
28
|
-
"recruitment",
|
|
29
|
-
"api"
|
|
30
|
-
],
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@types/node": "^25.6.0",
|
|
34
|
-
"tsup": "^8.0.0",
|
|
35
|
-
"typescript": "^5.0.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@prodigio-io/sdk",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Official JavaScript SDK for the Prodigio hiring API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
20
|
+
"build:cdn": "tsup src/cdn.ts --format iife --no-dts --minify --out-dir dist-cdn --clean",
|
|
21
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
22
|
+
"publish:cdn": "node scripts/publish-cdn.js"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"prodigio",
|
|
26
|
+
"hiring",
|
|
27
|
+
"jobs",
|
|
28
|
+
"recruitment",
|
|
29
|
+
"api"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^25.6.0",
|
|
34
|
+
"tsup": "^8.0.0",
|
|
35
|
+
"typescript": "^5.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|