Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Created January 30, 2022 23:40
Show Gist options
  • Save MeetMartin/58e2b7ecf60f02af0a0563b0c3385c08 to your computer and use it in GitHub Desktop.
Save MeetMartin/58e2b7ecf60f02af0a0563b0c3385c08 to your computer and use it in GitHub Desktop.
import { authentication } from 'didauth';
const payload = {
clientId: 'client id', // client id provided by MATTR
clientSecret: 'client secret', // client secret provided by MATTR
tenant: 'your-tenant.vii.mattr.global', // your tenant provided by MATTR
did: 'did:method:code', // your verifier DID representing your application created in MATTR platform
challengeId: 'your-challenge-id', // custom ID provided by your application to connect request internally
templateId: 'presentation template id', // presentation template ID created in MATTR platform
callbackURL: 'https://your-domain.tld/didauth/callback' // callback url of your website that the digital wallet will call
};
authentication(payload)
.trigger
(errors => console.log(errors) || ({
statusCode: 500,
body: 'Internal Server Error'
}))
(JWSURL => ({
statusCode: 301,
headers: {
locations: JWSURL
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment