@robireton/redcap
v0.4.0
Published
opinionated, JSON-only, zero-dependency REDCap API implementation as ECMAScript module
Downloads
71
Readme
REDCap API
an opinionated, JSON-only, zero-dependency REDCap API implementation as an ECMAScript module
Example
import REDCapAPI from '@robireton/redcap'
const endpoint = process.env.REDCAP_ENDPOINT
const token = process.env.REDCAP_TOKEN
const myProject = new REDCapAPI(endpoint, token)
console.log(await myProject.metadata())
Constructor
REDCapAPI
(endpoint, token)
| name | value |
| ---- | ----- |
| endpoint
| a URL or string to connect to – e.g. https://redcap.server.org/api/
|
| token
| the API token specific to your REDCap project and username (each token is unique to each user for each project) |
Instance methods
| name | value |
| ---- | ----- |
| options
| an optional object with extra parameters for REDCap API calls |
async version
()
returns the current REDCap version number as plain text (e.g., 4.13.18, 5.12.2, 6.0.0)