generateSignURL
Generate a URL to redirect the user to the JoyID App sign message page. This function cound be useful when you do not need to initiate sign request immediately.
Types
function generateSignURL ( request: SignMessageRequest, type: 'popup' | 'redirect'): stringinterface SignMessageRequest { /** * The URL of your app that JoyID app should redirect to after authentication */ redirectURL: string /** * name of your app */ name?: string /** * logo of your app */ logo?: string /** * The challenge that was requested to be signed */ challenge: string}
Example
async function mySignWithRedirect() { const request = { redirectURL: 'https://example.com', title: 'Example App', logo: 'https://example.com/logo.png', challenge: 'Sign this message', } const url = generateSignURL(request, 'redirect') // do something with the url // etc. await myFunction(url) // custom redirect window.location.href = url}