- JavaScript
- TypeScript
- ESM (ECMAScript Modules)
- CommonJS
What you need
Before getting started, ensure you have:- A valid LumiID API key.
- A server-side Node.js application.
- A valid test or production NIN.
- Node.js and npm installed.
1. Install the SDK
Install the LumiID package using your preferred package manager. npm2. Configure your API key
Store your LumiID API key in an environment variable. Create a.env file:
.env file to version control.
3. Quick start
Verify a Nigerian NIN using the LumiID JavaScript SDK.Verify a NIN
- Import
LumiIDandLumiIDError. - Initialize the SDK with your API key.
- Call
client.verify()with the identity type and number. - Check whether the response is an instance of
LumiIDError. - Process the successful verification response.
4. Use TypeScript
The LumiID SDK includes TypeScript declarations, so you can integrate it into TypeScript applications without installing additional type packages.5. Use CommonJS
For applications using CommonJS, import the SDK withrequire().
6. Handle verification errors
The SDK returns aLumiIDError instance when LumiID cannot complete a verification request.
Always check the returned result before accessing the successful verification response.
7. Production checklist
Before deploying your integration, ensure that:- Your API key is stored in a secure environment variable or secret manager.
- User input is validated before submitting verification requests.
- Verification requests are made exclusively from trusted server-side code.
- NINs and sensitive identity information are excluded from application logs.
- Verification errors are handled appropriately.
- Your production environment uses the correct LumiID API credentials.
8. Frequently asked questions
Does the LumiID SDK support TypeScript? Yes. The package ships with TypeScript declarations indist/index.d.ts.
Can I use the SDK in frontend applications?
No. The SDK requires a secret API key. Use it exclusively in trusted server-side environments such as Node.js backends.
Which module systems are supported?
The SDK supports both ESM and CommonJS.
- ESM:
import - CommonJS:
require()
client.verify() method to submit NIN verification requests.
Can I use the SDK with Express.js?
Yes. You can initialize the LumiID client in your Express.js backend and expose your own authenticated API route to your frontend.
9. Related documentation
- NIN Verification API: REST API documentation for direct NIN verification integrations.
- LumiID Developer Documentation: Explore additional LumiID integration resources.