Integrating Using the SDK
Installing the SDK
npm i @opengovsg/sgid-clientInitializing the SDK
import { SgidClient } from '@opengovsg/sgid-client'
// Replace the values below with your own client credentials
const client = new SgidClient({
clientId: 'CLIENT-ID',
clientSecret: 'cLiEnTsEcReT',
privateKey: '-----BEGIN PRIVATE KEY-----MII ... XXX-----END PRIVATE KEY-----',
redirectUri: 'http://localhost:3000/callback',
})Creating an authorization URL
Exchange auth code for access token
Request for user info
Last updated
Was this helpful?