Social Share and Metadata in Blockcerts

Can anyone offer advice/explanation on how the data needs to be inserted into your certificates to display the social share buttons and the metadata. I think it needs to be under metadataJson but haven’t had much success.

1 Like

I am trying to figure also anybody? Where is the metadatajson

metadataJson is part of the customisation of the context, as you will be able to see here: https://raw.githubusercontent.com/blockchain-certificates/blockcerts-verifier/master/test/fixtures/mainnet-valid-2.0.json
This is a variation of Blockcerts that has been specific to Learning Machine issued certificates. However you may also use, provided you define the key in the context.

@ampatt97, to display the social share and metadata json buttons, you need to set the corresponding attribute on the blockcerts-verifier on your page. ie:


https://github.com/blockchain-certificates/blockcerts-verifier/blob/master/demo/show-metadata.html.
I think I will be stating the obvious, but you need to set both flag if you want to activate both functionalities.

Social share then uses the record link: https://github.com/blockchain-certificates/blockcerts-verifier/blob/master/src/components/molecules/SocialShare/SocialShareContainer.js#L11, so no further configuration required.
Metadata will show your certificate.metadataJson property https://github.com/blockchain-certificates/blockcerts-verifier/blob/master/src/components/molecules/Metadata/MetadataContainer.js#L6. You will need to define this property in the context of the certificates.

Just to clarify, the verifier will look for the specific “metadataList” json in the certificate for displaying the metadata?

For others that want to display metadata, took me a little bit to figure out that the metadataJson attribute of the certificate needs to be a string with escaped json to display in the blockcerts-verifier properly.

Just to add some clarification to @ampatt97’s answer.
metadataJson was a custom property used by learning machine and not part of the initial spec of blockcerts. It is indeed a stringified json, which will get parsed by the blockcerts verifier.

As part of the v3 release, we have added the property metadata, which will behave similarly but will be made into the official blockcerts standard.