Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@opengovsg/myinfo-gov-client
Advanced tools
Readme
A lightweight client to easily call the MyInfo TUO endpoint for the Singapore government. Compatible with NodeJS version >=10.
'use strict'
const fs = require('fs')
const {
MyInfoGovClient,
CATEGORICAL_DATA_DICT, // Use this to look up code values
} = require('@opengovsg/myinfo-gov-client')
function main() {
// Your application configuration
const realm = '<Your Realm>'
const appId = '<Your App ID>'
const clientId = appId; // Usually the same value
const singpassEserviceId = '<Your SingPass e-Service ID>'
// Used for signing your request basestring with private key
const privateKey = fs.readFileSync('./secrets/privateKey.pem')
// MyInfo client
const myInfo = new MyInfoGovClient({
realm,
appId,
clientId,
singpassEserviceId,
privateKey,
mode: 'stg', // Set to 'dev' to call dev endpoint, leave empty for prod
});
// API params
const uinFin = 'S3000024B' // See list of dev/staging NRICs below
const requestedAttributes = [
'name',
'marriedname',
'hanyupinyinname',
'aliasname',
'hanyupinyinaliasname',
'sex',
'race',
'dialect',
'nationality',
'dob',
'birthcountry',
'secondaryrace',
'residentialstatus',
'passportnumber',
'passportexpirydate',
'email',
'mobileno',
'regadd',
'housingtype',
'hdbtype',
'mailadd',
'billadd',
'marital',
'edulevel',
'marriagecertno',
'countryofmarriage',
'marriagedate',
'divorcedate',
'childrenbirthrecords',
'relationships',
'edulevel',
'gradyear',
'schoolname',
'occupation',
'employment',
'workpassstatus',
'workpassexpirydate',
'householdincome',
'vehno',
];
const txnNo = 1234 // an optional transaction number
// API parameters
var params = {uinFin, requestedAttributes, txnNo}
// Make API call
myInfo.getPersonBasic(params)
.then(function(personObject) {
console.log('Results of Person-Basic endpoint:\n', personObject)
})
.catch(function(error) {
console.log('Error:\n', error)
})
}
main()
See a list of available MyInfo test accounts here.
We welcome contributions to code open-sourced by the Government Technology Agency of Singapore. All contributors will be asked to sign a Contributor License Agreement (CLA) in order to ensure that everybody is free to use their contributions.
FAQs
A lightweight client to easily call the MyInfo Person v3.2 endpoint for the Singapore government. Tested with NodeJS version >=12.
The npm package @opengovsg/myinfo-gov-client receives a total of 293 weekly downloads. As such, @opengovsg/myinfo-gov-client popularity was classified as not popular.
We found that @opengovsg/myinfo-gov-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.