Igrantio individuals
Onboard application users into the iGrant.io Consent Building Block as "individuals" and keep a mapping between your own userId and the returned individualId. Node/TypeScript backend for the Consent BB admin Individual API (create, read, update, list). Use when an application signs up users and must create a corresponding individual so GDPR consents can later be recorded against a data agreement. Pairs with igrantio-consent-records.From its SKILL.md
npx -y skills add L3-iGrant/skills --skill igrantio-individualsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.9 KB, 999 tokens by cl100k_base, as published. Nobody here has run it
iGrant.io individuals (Consent BB admin Individual API)
When to use
When your app onboards a user, create a matching individual in the iGrant.io
Consent Building Block and store the returned individualId against your own
userId. That mapping is what later lets igrantio-consent-records record and
manage consents for the right person.
Integrator intake
Ask one question at a time, a recommended default with each; look up facts in the project, put only decisions to the integrator:
- Environment - demo (
https://demo-api.igrant.io), staging, or a custom Consent BB deployment (ask its base URL)? Recommend demo to start. - API key - organisation API key for the Consent Building Block? From your iGrant.io organisation account; server-side only, never the browser.
- Mapping storage - where does the
userIdtoindividualIdmapping live: a column on the existing users table (recommended) or a separate store?
The mapping (the important part)
your users table Consent BB
+----------+-------------+ +---------------------------+
| user_id | individual | <──────► | individual { id, ... } |
| u_123 | 6541...cd | | externalId = "u_123" |
+----------+-------------+ +---------------------------+
Persist individualId in YOUR database keyed by your userId. The reference uses
externalId = your userId so the individual is also recoverable from OWS if the
local mapping is ever lost.
API (Consent BB admin, base /v2, Authorization: ApiKey <key>)
| Method | Path | Purpose |
|---|---|---|
| POST | /v2/config/individual | Create individual → returns individual.id |
| GET | /v2/config/individual/{id} | Read individual |
| PUT | /v2/config/individual/{id} | Update individual |
| GET | /v2/config/individuals?limit=&offset=&externalIndividualId= | List (find by your userId) |
Individual fields: name, email, phone (required), externalId,
externalIdType, identityProviderId, iamId, mapperId, deviceType, …
Reference
src/consentClient.ts- dependency-free Consent BB client (individuals.*+consentRecords.*).src/mappingStore.ts-IndividualMappingStore(userId ↔ individualId); in-memory + DB-swappable.src/onboarding.ts-ensureIndividual(client, store, userId, profile): idempotent (local mapping → lookup by externalId → create).src/server.ts- example onboarding endpoints (POST /individuals/onboard,GET /individuals/me).
Steps
cd references && cp .env.example .env; setOWS_ENV(demo|staging),OWS_API_KEY.npm install.- In your authenticated signup handler:
const client = createConsentClient({ owsBaseUrl: config.owsBaseUrl, apiKey: config.apiKey }); const individualId = await ensureIndividual(client, store, session.userId, { name, email, phone }); // store.set already persisted userId -> individualId; save it in your users table toouserIdmust come from your session - never from request input.
Clean-code notes
- The client is the only place Consent BB paths live; onboarding logic is one idempotent function; the mapping store is an interface you back with your DB.
- The org API key stays server-side; browsers never call the Consent BB directly.
Validation / done criteria
npm run typecheckpasses.- Onboarding the same user twice returns the same
individualIdand creates one individual (idempotent). - Your DB holds
userId → individualIdafter onboarding.
Documentation & workflows
When anything is unclear, consult the iGrant.io documentation before guessing:
- iGrant.io developer APIs (index): https://docs.igrant.io/docs/developer-apis
- Getting started: https://docs.igrant.io/docs/get-started/
- Consent management - individual API: https://docs.igrant.io/docs/category/consent-management-individual-api/organisation
- Consent management - admin API: https://docs.igrant.io/docs/category/consent-management-admin-api/data-agreement
What ships with it: 9 files
14.6 KB alongside SKILL.md, 5 of them executable
references/
- .env.example413 B
- package.json599 B
- README.md783 B
- src/config.tsruns831 B
- src/consentClient.tsruns6.9 KB
- src/mappingStore.tsruns792 B
- src/onboarding.tsruns1.8 KB
- src/server.tsruns2.3 KB
- tsconfig.json284 B