ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
330 stars 98 forks source link

tonconnect-manifest hosted on a cdn service #12

Closed k6c8e4 closed 1 year ago

k6c8e4 commented 1 year ago

Hi people :)

I wanna know if can it be possible to use cdns to serve manifest file for TonConnect? I wanna use this awesome library to create an extension for no-code app builder, which allows storing files in the root folder of the project only on a paid plan, which is useless in case I wanna build this extension without possibility to store tonconnect-manifest file in the root folder. If it isn't possible now, will it be possible in the future maybe?

Some screens:

  1. manifest file image

  2. after connect, deeplink converted into a QR code image0

  3. after scanning the QR code using Tonkeeper, in the connector "OnStatusChange" I'm getting in trouble ) image1

If you can help me figure it out how to use manifest file stored on a cdn service, it will be a great boost to bring no-code platforms to build dapps using TonConnector <3

Cheers

siandreev commented 1 year ago

Hi, you can specify the manifest URL in the TonConnect constructor parameters: const connector = new TonConnect({ manifestUrl: 'https://<your-url>/tonconnect-manifest.json' });

inartin commented 1 year ago

Hi @siandreev he is my teammate, we tried to fix it this way but we get the same error.

k6c8e4 commented 1 year ago

@siandreev yo,

I'm afraid I cannot use this case:

const connector = new TonConnect({ manifestUrl: 'https://<your-url>/tonconnect-manifest.json' });
  1. because <your-url> means url of my aplication, but the tonconnect-manifest itself is hosted on an external CDN <cdn-url>. so if I will use const connector = new TonConnect({ manifestUrl: 'https://<cdn-url>/tonconnect-manifest.json' }); it will throw the error mentioned in the initial question.

And the question remains the same. Can we host manifest file on an external cdn/storage then use the url in the connector? Or maybe it will be possible in the future?

Best regards,

siandreev commented 1 year ago

You can place the ton-menifest.json anywhere you want. It might be CDN or any hosting, not necessarily associated with the app. Please, check an example and hit me, if the problem persists.

k6c8e4 commented 1 year ago

@siandreev yo nice, this looks good to me. I'll give it a try and will be back with a feedback. Ty again :)

k6c8e4 commented 1 year ago

@siandreev all good, sorry for troubles :) thank you for implication

best regards,