[FEATURE REQUEST] Web Crypto unavailable in POS UI Extensions (iOS & Android) and admin UI extensions

Hi all,

I’m trying to build a POS UI extension that issues end-to-end encrypted digital receipts. The receipt is encrypted on the device and then send to us where it’s decrypted on the users device, so we can never read what they bought.

The extension runtime however has no Web Crypto at all, on both platforms:

  • iOS POS globalThis.crypto / window.crypto / self.crypto are all undefined (no getRandomValues(), no subtle). WebAssembly is also undefined.
  • Android POS same result.

Web Crypto is a standard, non privileged browser API and I believe it is exposed in other places. Within Shopify? Without it, extensions cannot generate secure keys, IV’s or UUID’s, or do any client side encryption.

Request from our side is to please expose the Web Crypto API in POS UI Extensions.

Is this planned? Or is there a supported way to use Web Crypto in these runtimes today?

Cheers,

Teije

Hi @Wes-Dev-Shopify ! I saw your reaction with the glasses, does that mean you’re looking into this? :grinning_face_with_smiling_eyes: Happy to provide any additional details or help with testing if needed!

Hey @TeijeKuiken :waving_hand: sorry for the delay here :sweat_smile: thanks for flagging this, and for explaining the encrypted receipts use case.

Yes, I’m looking into it. You’re right that globalThis.crypto, self.crypto, and window.crypto aren’t defined in POS UI extensions on iOS and Android or in admin UI extensions, and WebAssembly isn’t available either. Web Crypto isn’t a documented API for these extensions right now.

I’m looking into whether there’s a supported option for your use case, and I’ll follow up here when I hear back.

Hey @Wes-Dev-Shopify, no worries! I’m already really happy you’re looking into it! Exposing the Web Crypto API would be ideal for our use case, but I understand there may be technical limitations. Either way, I really appreciate the support! :slightly_smiling_face:

@TeijeKuiken shopify dev jumping in here. You mentioned WebAssembly as well, would that be necessary or is that to enable something else? Again nothing to report on our end but wanted to make sure I captured that use case too :slightly_smiling_face:

Hey @Aaron_Schubert, thanks for jumping in!

No, we don’t need WebAssembly. I only mentioned it because I was checking what the runtime exposes, and a crypto library compiled to WASM was one possible workaround. Web Crypto is what we really need.

Ideally the full Web Crypto API (globalThis.crypto, including crypto.subtle) would be exposed. We’d much rather not write or bundle our own crypto code in the extension. The native implementation is well-audited and maintained by the platform vendors, and it will always be a safer bet than anything we ship ourselves.

Happy to share more details or help test if that’s useful!

Cheers,
Teije