Developer Questions
Browserified frontend JWT getOTT not working
Hi, I'm trying to make a simple frontend page to make a payment using XUMM. I don't want any backend. I've found in the docs that there is a frontend only way to accomplish this, using JWT endpoints.
See here: https://xumm.readme.io/reference/xapps-jwt-endpoints
In Option #1: Use the XUMM SDK in your xApp frontend
I've created an api key/secret at https://apps.xumm.dev/
I created a page with the code to get OTT (I replaced the api key with my key):
const {XummSdkJwt} = require('xumm-sdk')
const Sdk = new XummSdkJwt('8525e32b-1bd0-4839-af2f-f794874a80b0')
Sdk.getOttData().then(c => {
console.log('OTT Data', c)
Sdk.ping().then(c => {
console.log('Pong', c)
})
})
I load the page, but there is no console log with "OTT Data", nor "Pong". So basically the code provided is wrong, or the SDK is buggy (or has changed and the example is not working anymore).
Also the jsfiddle provided (I also updated the jsfiddle with my api key) in the page doesn't work. It tells to check the browser logs, but no logs appear.
Help please.