
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
A TypeScript SDK for seamlessly interacting with the [KoboToolbox](https://www.kobotoolbox.org/) API, abstracting its complexities. **Optimized for TypeScript, with full type definitions.**
A TypeScript SDK for seamlessly interacting with the KoboToolbox API, abstracting its complexities. Optimized for TypeScript, with full type definitions.
npm install kobo-sdk
import {KoboClient} from 'kobo-sdk'
const sdk = new KoboClient({
urlv1: 'https://kc.kobotoolbox.org',
urlv2: 'https://kf.kobotoolbox.org',
token: '<YOUR PRIVATE TOKEN>',
})
Parameter | Required | Description |
---|---|---|
urlv1 | ✅ | Alias kc_url . KoboToolbox provides two API versions; this one is specifically used for submitting data to a form, as there is no equivalent endpoint in v2. |
urlv2 | ✅ | Alias kf_url . |
token | ✅ | Private API token, available in your KoboToolbox account settings. |
ApiClientClass | ❌ | Uses Axios by default. This parameter allows for a custom HTTP client. |
log | ❌ | Logs output to the console by default. |
Server | V1 (kc) | V2 (kf) |
---|---|---|
EU | https://kc-eu.kobotoolbox.org | https://eu.kobotoolbox.org |
Global | https://kc.kobotoolbox.org | https://kf.kobotoolbox.org |
DRC | https://kc-kobo.drc.ngo | https://kobo.drc.ngo/ |
Only the question name (without the begin_group
path) is used as a key when submitting data.
The Kobo API expects grouped questions in a nested structure, but
this function automatically handles the formatting.
If submission fails, it retries up to 5 times by default, which can be adjusted using the retries
parameter.
await sdk.v1.submission.submitXml({
formId: 'aM29e4jscqujByADmvDLrr',
attachments: [{
name: 'filename as indicated in the answers',
url: 'URL to the file. Altenarively you can use `path` instead of `url` to select a local file.',
}],
data: {
question_text: 'answer',
question_integer_variant1: 1,
question_integer_variant2: '1',
question_select_multiple: 'option1 option2',
question_select_one: 'option1',
question_begin_repeat: [
{question: 'answer1'},
{
question: 'answer2',
question_nested_repeat: [{question_nested: 'answer'}],
},
],
},
})
Only the question name (without the begin_group
path) is used as a key when submitting data.
The Kobo API expects $xpath
as a key, including begin_group
s but
this function automatically handles the formatting.
If submission fails, it retries up to 5 times by default, which can be adjusted using the retries
parameter.
[!NOTE] The Kobo API fails if it receives too many updates in a short time, but this function automatically splits requests into smaller chunks and queues calls, ensuring updates are throttled at a pace the Kobo API can handle.
await sdk.v2.submission.update({
formId: 'aM29e4jscqujByADmvDLrr',
submissionIds: ['1', '2'],
data: {
question_text: 'New answer',
question_select_multiple: 'option1 option2 option3',
},
})
Supports filtering _submission_time
by range, limit, and offset.
The Kobo API limits responses to 30,000 submissions per request to prevent timeouts, but this function automatically
splits API calls into chunks and merges results, allowing retrieval of any number of submissions seamlessly.
sdk.v2.submission.get({
formId: 'aM29e4jscqujByADmvDLrr',
filters: {
start: new Date(2024, 0, 1),
end: new Date(2024, 0, 1),
offset: 10,
limit: 5e4,
}
})
[!IMPORTANT] The function removes paths from keys and extracts answers from metadata. To retrieve the raw API response, use
sdk.v2.submission.getRaw
instead.
const form = await sdk.v2.form.get('aM29e4jscqujByADmvDLrr')
const permissions = sdk.v2.form.getPermissionSummary(form)
// > [{userName: 'user1', permissions: ['add_submissions delete_submissions manage_asset validate_submissions view_asset view_submissions']}]
/v1/submission.xml
endpoint, as JSON submissions cause bugs.formhub/uuid
.instanceID
.$xpath
as keys.start
and end
query parameters.We highly recommend using this SDK with TypeScript instead of JavaScript for full type support and to save yourself from unnecessary frustration. If you're not a developer or unfamiliar with TypeScript, don’t worry, the type system will guide you along the way.
Contributions are welcome! Feel free to submit a PR or open an issue.
FAQs
A TypeScript SDK for seamlessly interacting with the [KoboToolbox](https://www.kobotoolbox.org/) API, abstracting its complexities. **Optimized for TypeScript, with full type definitions.**
The npm package kobo-sdk receives a total of 28 weekly downloads. As such, kobo-sdk popularity was classified as not popular.
We found that kobo-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.