@timeback/clr and timeback-clr wrap the authenticated CLR v2.0 API. The client exposes credentials.upsert() and discovery.get().
Install
Credential contract
credentials.upsert() sends POST /ims/clr/v2p0/credentials/. The receiver creates or updates a record identified by credential id and issuer id, returning the stored credential with HTTP 201 or 200. This path does not add a signature, verify a supplied proof, or aggregate a student’s records automatically.
The receiver requires:
- Three ordered contexts: W3C credentials v2, CLR v2, then Open Badges v3.
typecontaining bothVerifiableCredentialandClrCredential.- An issuer profile, credential name, URI identifier and ISO date in
validFrom. - A
ClrSubjectwith at least one nestedverifiableCredential. - At least one top-level
credentialSubject.achievement. This is an additional receiver requirement: an achievement nested only inside a child credential is insufficient. Each achievement needs an ID, type, name, description and criteria.
Example
This example illustrates the accepted structure. Replace the sample issuer, learner, achievement and credential records with your own authorized records before submitting.credential.json
Discovery and composition
discovery.get() calls the authenticated discovery endpoint and returns its OpenAPI document. Route descriptions may describe intended capabilities; credential signing is not implemented by the reviewed upsert handler.
The same resources are available through timeback.clr on the Core client. Standalone configuration supports environment mode, explicit base/auth URLs, or a shared TimebackProvider; the optional request timeout is milliseconds in TypeScript and seconds in Python.