Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Node script to onboard asset metadata to the Copyright Hub

This is a simple Node.js script that allows asset metadata to be added ("onboarded") to a Copyright Hub repository.

The Copyright Hub aims to help copyright work the way the internet works by making the process of giving and getting permission – the basic building block of the copyright process – fit for purpose in the age of the Internet.


Script and dependencies

Clone the repo and install dependencies with

git clone
cd hubOnboard
npm install


You need to have credentials for onboarding to the Copyright Hub. Get in touch with them and ask them. Once you have those, create a configProd.json and a configStage.json files with the credentials for production and staging, e.g:

"clientID" : "344444467a59f6113957ed42a46",
"clientSecret" : "RdvTIMfDk42zd33PvoUReWJcy5rLl0",
"repo" : "4410e8fb90d2a8d32d9c55e2a4834a4b"


You need to supply a tab-separated csv file with fields for:

  • source_id_type (at least one is mandatory. More than 1 separated by ~)
  • source_id (at least one is mandatory. More than 1 separated by ~)
  • offer_id (optional. More than one separated by ~)
  • description (optional)

Example row with multiple ids and a single offer:

plsid~isn	2844132~9781784717506	2d9c55e2a44410e8fb9d3834a4b0d2a8	Principles of Law and Economics Third Edition

You can then call the script from the command line thus:

node auth.js env=prod source=myfile.csv results=myresults.txt


  • env is one of prod | stage (if not supplied, it will assume it is stage)
  • source is the csv file in the format specified above.
  • results is the file where the script results will be written. For every successful row onboarded from the csv file it will write a line into the results file that looks like this:
plsid~isn	2844127~9781781956021		Principles of Law and Economics Third Edition

The last column is the item's "hubkey". This is a URI and its contents can be inspected by doing:

on staging, or

on production.


NodeJS script to add content to the Copyright Hub ecosystem




No releases published


No packages published